This is far from duplicate of this question since that question doesn't even use requests for scraping but only for session and getting page content. I use it as well in such manner with Beautiful Soup.
I have also tried this. But they also didn't explain how to use requests effectively for getting JavaScript content.
I'm trying to scrape info from web page which is rendered by JavaScript code. I'm using requests
module in Jupyter notebook which.
When I use following sample code:
import asyncio
from requests_html import AsyncHTMLSession
asession = AsyncHTMLSession()
r = await asession.get('http://python-requests.org')
r.html.render()
r.html.search('Python 2 will retire in only {months} months!')['months']
I get error:
RuntimeError: This event loop is already running
I need some advice on how to implement this comment to make it work since when I type in Jupyter notebook :
asyncio.get_event_loop()
I get:
<_WindowsSelectorEventLoop running=True closed=False debug=False>
so I need way to use existing loop in Jupyter notebook.