0

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?

Peter Mortensen
  • 30,030
  • 21
  • 100
  • 124
jwoojin9
  • 265
  • 4
  • 15

1 Answers1

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..
  • 471
  • 5
  • 11