psf / requests-html

Pythonic HTML Parsing for Humans™
http://html.python-requests.org
MIT License
13.72k stars 978 forks source link

"Your browser is outdated" error #553

Closed synalice closed 1 year ago

synalice commented 1 year ago

I've tried running this piece of code:

from requests_html import HTMLSession

session = HTMLSession()
r = session.get("https://vk.com/")
r.html.render()
print(r.text)

Everything related to the library works as expected, except that the HTML response from the website tells me that my browser version is outdated. Is there something that can be done?

I am using requests-html of version 0.10.0.

synalice commented 1 year ago

I experimented with adding wait=4 and sleep=4 but with no success.

kurotom commented 1 year ago

I think it's because of the browser version used in 'User–Agent' headers. A user-agent string must be searched to fix the problem.

ajatkj commented 1 year ago

This project uses pyppeteer which is uses very old version of Chromium. This is easily fixable. You can check my comment on another issue here.