I have to scrape a JavaScript-rendered page in Python, but without Selenium. It must work for any pages, and I haven't found a proper way to that. How can I do it?
Asked
Active
Viewed 1,303 times
1 Answers
1
requests-HTML uses Chromium to render JavaScript.
It will download Chromium in your home directory the first time you run render.
r = session.get('http://python-requests.org/')
r.html.render()
r.html.search('Python 2 will retire in only {months} months!')['months'] '<time>25</time>'
Source: Documentation

Ash Ishh
- 551
- 5
- 15
-
the documentation link provided is for the 'Requests-HTML' package, not 'requests' – Corey Goldberg May 20 '19 at 01:52
-
1Correct link: https://docs.python-requests.org/projects/requests-html/en/latest/ – Igor Voltaic Nov 13 '21 at 05:45