execute-script

Wait until page is loaded with Selenium WebDriver for Python

Wait until page is loaded with Selenium WebDriver for Python Question: I want to scrape all the data of a page implemented by a infinite scroll. The following python code works. for i in range(100): driver.execute_script(“window.scrollTo(0, document.body.scrollHeight);”) time.sleep(5) This means every time I scroll down to the bottom, I need to wait 5 seconds, which …

Total answers: 17