requests-html icon indicating copy to clipboard operation
requests-html copied to clipboard

'Future' object has no attribute 'html'

Open tjblue opened this issue 4 years ago • 8 comments

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.

tjblue avatar Jun 05 '20 18:06 tjblue

I am also having this issue

Fawaz441 avatar Jul 04 '20 00:07 Fawaz441

Same, does anyone know how to solve this?

fayedraza avatar Jul 28 '20 08:07 fayedraza

Same problem here.

tikoponde avatar Oct 26 '20 18:10 tikoponde

Same problem too.

YasserKhalilExcelEgy avatar Oct 29 '20 16:10 YasserKhalilExcelEgy

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().

PeterNjeim avatar Nov 24 '20 21:11 PeterNjeim

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

syafiqabdillah avatar Dec 25 '20 01:12 syafiqabdillah

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.

salty-chris avatar Feb 07 '21 01:02 salty-chris

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.

MorrisonWill avatar Feb 20 '21 22:02 MorrisonWill