Issue
I am trying to scrape results from this page:
https://results.chronotrack.com/event/results/event/event-24381
This is what I can do manually:
1) Open above URL in chrome
2) Click on the Results tab
2.5) Sometimes change the race distance
3) Click Next to get to page 2
4) Open developer tools / network
5) Click previous to get back to the first page
6) Get the Request URL from the results-grid?callback element from developer tools:
Once I get this far I can manipulate the DisplayStart parameter to get the rest of the results.
Is there a way for me to find that URL using requests and/or selenium? With Selenium I tried opening the first page then clicking over to results with the following:
driver.find_element_by_id('resultsResultsTab').click()
But I get the following error:
Element is not currently visible and may not be manipulated
Can anyone get me pointed in the right direction?
Solution
Try to wait until required element becomes visible:
from selenium.webdriver.support.ui import WebDriverWait as wait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
wait(driver, 10).until(EC.visibility_of_element_located((By.ID, 'resultsResultsTab'))).click()
Answered By - Andersson
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.