Skip to content
Advertisement

using selenium.click() to change pages but gets error

I’m trying to click on a div to get to the next page of a table (the url does not change when the page changes). The go to the next page div has the same class as the go to the previous page’s. ive used:

JavaScript

and it worked to get me to page 2, but after page 2 it gives me the error:

JavaScript

Do you know if there is an issue that i am able to call elem.click() after using selenium to find other parts of the page. I’m scraping data from https://nonfungible.com/market/history

Advertisement

Answer

I guess the issue here is that the next page button appears on the bottom of the page, so to click on it you should first scroll this element into the view.
See if this will work now:

JavaScript

I didn’t check correctness of the rest of your code, but clicking the next button should work now

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement