Render() not updating info in HTMLSession in requests-html?

19 views Asked by At
session = HTMLSession()
response = session.get(url=url, headers=headers)
response.html.render(script=script, sleep=5)
print(response.html.find('#timer', first=True).text)
sleep(3)

response.html.render()
print(response.html.find('#timer', first=True).text)

The first render() call injects js to start a countdown timer. The timer prints 6 (the timer begins at 10) in the first print statement, indicating that the countdown was correctly started. When I render the page a second time, the timer then resets back to 10. What could be the issue?

I've tried adjusting values, parameters, packages, but I can't figure it out. My goal is to call a function when the countdown timer reaches zero. I've updated all my packages and also downloaded reqeusts.html from github since it's updated.

0

There are 0 answers