1


I'm using selenium to get the html for this site:
http://timesofindia.indiatimes.com/world/us

I'm using selenium because this site only gives you all the html if you scroll down. However when I run this code:

 # Open the Driver
 driver = webdriver.Chrome(chromedriver)

#create a list to store the htmls
master_lst = []

#looping through the times of india urls
for url in urls[:3]:

#make the driver the the url
driver.get(url)
#this is to scroll down twelve time
for i in range(12):
    # wait 5 seconds
    time.sleep(5)
    driver.execute_script("window.scrollTo(0, document.body.scrollHeight);")

html_source = driver.page_source
data = Beautifulsoup(html_source, 'lxml')
master_lst.append(data)

I get this error:
TimeoutException: Message: timeout: Timed out receiving message from renderer: -0.004

I've tried to change the sleep times and the times I scroll down to no avail.
I've seen similar question in here but none that address this kind of problem.
Let me know what you all think!
Thanks!

1 Answer 1

2

You may need to adjust the script timeout:

driver.set_script_timeout(10)
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks you!!! Just attaching another useful link stackoverflow.com/questions/48941260/…

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.