1

My goal is to loop through each of the pages and scrape the contents into a DataFrame. So far, I can get the first 20 no problem. I cannot seem to figure out how to navigate to the next page on a javascript table using python selenium chrome webdriver. Have tried a few of the solutions (below seems like the closest) but cannot replicate the result. I would post the website but it is one where you need log in credentials to access. Provided a page source screenshot for the relevant ul and li elements

stackoverflow solution tried: How to click on the list of the <li> elements in an <ul> elements with selenium in python?

Am able to get the first 20 rows using: driver.find_element_by_xpath('//*[@id="allPicksId"]/div/div[2]').text

Then, when trying to get the next rows on next table page using the code below I get an exception:

next_table_page = WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.CSS_SELECTOR, ".ant-pagination-next"))).click()

Yields this exception:
ElementClickInterceptedException: Message: element click intercepted: Element is not clickable at point (546, 996)

Any guidance would be appreciated!

Page Source Photo

Table Page Navigation Bar Photo

1
  • did u tried the button instead of li ant-pagination-item-link ? as they shared on same space ..then next attempt would be to hit span area. Commented Apr 24, 2021 at 19:52

2 Answers 2

1

I think I figured it out by using the code below:

element = driver.find_element_by_class_name('ant-pagination-next')
driver.execute_script("arguments[0].click();", element)
Sign up to request clarification or add additional context in comments.

Comments

0

you can use for loop to handle this

example:

for I in range(1, 23):
      driver.find_element_by_xpath().click()

Or

you can use the site URL to go next page

see this url

and second url

now you must change the number of pages to go next page

3 Comments

Unfortunately, there is no page number in the URL. It is all navigated based on the buttons. I plan on just using a loop whenever I figure out how to get to the next table page
send XPath of pages 18, 19, 20, 21, 22
I got the final page number text extracted and used a while loop to control the amount of clicks for the next page button to terminate once the end page number is reached. Took a little digging but finally got the answer to my question and posted it above.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.