Skip to content

Instantly share code, notes, and snippets.

@AnasAlmasri
Created May 9, 2020 17:40
Show Gist options
  • Save AnasAlmasri/e84c280cde87f589fe3bfc6bedf70475 to your computer and use it in GitHub Desktop.
Save AnasAlmasri/e84c280cde87f589fe3bfc6bedf70475 to your computer and use it in GitHub Desktop.
# get stats table
stats_table = WebDriverWait(driver, 10).until(lambda driver: driver.find_element_by_xpath('/html/body/div[1]/div[2]/div/div[3]/div/div[4]/table'))
time.sleep(sleep_duration)
# scroll a couple of times to make sure the whole table is rendered
driver.execute_script("window.scrollTo(0, document.body.scrollHeight);")
time.sleep(nap_duration)
driver.execute_script("window.scrollTo(0, document.body.scrollHeight);")
time.sleep(nap_duration)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment