Sharid
Well-known Member
- Joined
- Apr 22, 2007
- Messages
- 1,066
- Office Version
- 2016
- Platform
- Windows
My page navigation has stopped on the Indeed Job search web site. It keeps going from Page 1 to 2 and then back to 1. I can not navigate to page 3 and beyond.
I have been trying to fix it for sometime but can not work out the class or the queryselector. Can someone please take a look and advise were I am going wrong.
This is NO LONGER working
I have tried the following and several other variations, however nothing seems to work, either it does not go beyond page 1 or loops between page 1+2
For more information Please see this link StackOverflow
I need to select the last "li" and then the a tag or a class in that, however I can not work out how to SELECT the LAST "li" Tag
I have been trying to fix it for sometime but can not work out the class or the queryselector. Can someone please take a look and advise were I am going wrong.
This is NO LONGER working
VBA Code:
Do
If pageNumber >=6 Then Exit Do
On Error Resume Next
Set nextPageElement = HTML.getElementsByClassName("np")(0) ' CLICK TO NEXT PAGE
If nextPageElement Is Nothing Then Exit Do
Application.Wait (Now + TimeValue("0:00:04"))
nextPageElement.Click 'next web page
Do While objIE.Busy = True Or objIE.readyState <> 4
Loop
I have tried the following and several other variations, however nothing seems to work, either it does not go beyond page 1 or loops between page 1+2
VBA Code:
Do
If pageNumber >=6 Then Exit Do
'Set nextPageElement = HTML.getElementsByClassName("pagination-list")(0)
Set nextPageElement = HTML.getElementsByClassName("pagination")(0)
'Set nextPageElement = HTML.getElementsByClassName("np")(0)
If Not nextPageElement Is Nothing Then
nextPageElement.document.querySelector(".np").Click
'nextPageElement.document.querySelector(".pn").Click
'nextPageElement.document.querySelector("span.pn").Click
'nextPageElement.document.querySelector("span.np").Click
'nextPageElement.document.querySelector(" .pagination-list li:last-child").Click
Application.Wait (Now + TimeValue("0:00:04"))
Else:
Exit Do
End If
Do While objIE.Busy = True Or objIE.readyState <> 4
Loop
For more information Please see this link StackOverflow
I need to select the last "li" and then the a tag or a class in that, however I can not work out how to SELECT the LAST "li" Tag