Jump to content
Sign in to follow this  
dushkin

Finding if a link is clickable

Recommended Posts

dushkin

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

Share this post


Link to post
Share on other sites
FireFox

Local $oNextPage = _IEGetObjById($oIE, "pagnNextLink")

If IsObj($oNextPage) = 0 Then
    ;End reached
Else
    ;...
EndIf


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
dushkin

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

Share this post


Link to post
Share on other sites
FireFox

I wrote pagnNextLink


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
dushkin

Well , you are right!

I didn't notice the change.

Thanks a lot!!!

Share this post


Link to post
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
Sign in to follow this  

×