Python Forum

Full Version: requests-html + Beautifulsoup
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I am trying to scrape a dynamic web page. The code I use is:

from requests_html import HTMLSession
from bs4 import BeautifulSoup

session = HTMLSession()

url = 'someurlhere'

r = session.get(url)
r.html.render(keep_page=True, sleep=1,timeout=10,wait=2)
Question 1: How do I save the rendered HTML to file?
Question 2: How do I feed the rendered HTML to Beautifulsoup?

Thank you!