dushkin Posted March 4, 2014 Posted March 4, 2014 (edited) 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 March 4, 2014 by dushkin
Solution FireFox Posted March 4, 2014 Solution Posted March 4, 2014 Local $oNextPage = _IEGetObjById($oIE, "pagnNextLink") If IsObj($oNextPage) = 0 Then ;End reached Else ;... EndIf
dushkin Posted March 4, 2014 Author Posted March 4, 2014 (edited) 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 March 4, 2014 by dushkin
dushkin Posted March 4, 2014 Author Posted March 4, 2014 Well , you are right! I didn't notice the change. Thanks a lot!!!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now