requests-html
requests-html copied to clipboard
'Future' object has no attribute 'html'
from requests_html import AsyncHTMLSession
import asyncio
if asyncio.get_event_loop().is_running(): # Only patch if needed (i.e. running in Notebook, Spyder, etc)
import nest_asyncio
nest_asyncio.apply()
req = AsyncHTMLSession()
page = req.get('https://www.google.com')
page.html.arender
I can't seem to figure out how to fix it.
I am also having this issue
Same, does anyone know how to solve this?
Same problem here.
Same problem too.
Same problem here Edit: Actually I found the solution, simply use "await" when doing anything with session. Like: webpage = await session.get() instead of webpage = session.get().
Same problem here Edit: Actually I found the solution, simply use "await" when doing anything with session. Like: webpage = await session.get() instead of webpage = session.get().
this solve my problem, thanks
Same issue, workaround does not resolve issue.
session = AsyncHTMLSession()
resp = await session.get(urlreq)
^
SyntaxError: invalid syntax
IDE also complains that Class 'Response' does not define 'await', so the 'await' operator cannot be used on its instances.
Same issue, workaround does not resolve issue.
session = AsyncHTMLSession() resp = await session.get(urlreq) ^ SyntaxError: invalid syntax
IDE also complains that Class 'Response' does not define 'await', so the 'await' operator cannot be used on its instances.
My IDE (pycharm) is also doing this. Is there any way to fix that? I hate having warnings in my code.