await
Microsoft Windows [Version 10.0.19044.1766] (c) Корпорация Майкрософт (Microsoft Corporation). Все права защищены.
C:\Users\admin>python Python 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.
from requests_html import AsyncHTMLSession asession = AsyncHTMLSession() r = await asession.get('https://python.org/') File "
", line 1 SyntaxError: 'await' outside function
I figured out what the problem is. Javascript components have not been installed.
from requests_html import AsyncHTMLSession
asession = AsyncHTMLSession()
async def test():
r = await asession.get("https://python.org")
asession.run(test)
Thanks to. Yes. I studied the example and then realized that I need to run the render function so that the missing components are downloaded first. Perhaps it's better to download the components separately manually and install, since it didn't start downloading on the first try, if I remember correctly.
Alright, closing!