Jump to content

Finding if a link is clickable


Go to solution Solved by FireFox,

Recommended Posts

Hi All,

Seemingly a simple issue, but...

I tried to automate a product search on Amazon. For example a book.

To move to the next page I detected the "Next Page" link and used

_IEAction($oNextPage,"Click")

 to click it.

Until here every thing is fine.

The problem I have is when I reach the end of the list, which happens when the books list in the category reached its end, or we browsed 400 pages.

Then the "Next Page" link is disabled. 

For example you can go to the next link.

So, I tried to use the following code to check if it is disabled:

Local $oNextPage = _IEGetObjById($oIE, "pagnNextString")
$linkStatus = _IEPropertyGet($oNextPage, "isdisabled")
If $linkStatus = True Then

etc.

But I always got false! Even when we reached the end of the list.

What do I do wrong here? And is there another way to handle it.

I suspect, that actualy the "next page" is not a link but turns to be a special image when it seems as disabled (gray). 

Thanks!

Edited by dushkin
Link to comment
Share on other sites

Thank you firefox for your kind help.

But it doean't work for me.

Here is the code fragment :

while()
.
.
.

        Local $oNextPage = _IEGetObjById($oIE, "pagnNextString")
        If IsObj($oNextPage) = 0 Then
            ExitLoop
        Else
            _IEAction($oNextPage,"Click")
            _IELoadWait($oIE)

        EndIf
.
.
.
WEnd

It just goes on and on and does not exit the loop...

Maybe there is a way to know if an object is a link... I will try to use _IELinkClickByText and see if it will return me an error.

Thanks.

Edited by dushkin
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...