I'm trying to asynchronously load content of a web page. I have used requests_html, as I face some problem installing it on my server so I am using asyncio
@asyncio.coroutine async def extract_feature(): try: count = 0 key = '' loop = asyncio.get_event_loop() response = await loop.run_in_executor(None, requests.get, link) soup = BeautifulSoup(response, "html.parser") return soup loop = asyncio.get_event_loop() result = loop.run_until_complete(extract_feature) But this raises A Future or coroutine is required.
One thing to mentioned I'm using Python 3.5.0 (v3.5.0:374f501f4567) which doesn't support run.
try:must have a matchingexceptorfinallyclause. Please post the traceback you get and the actual code you are using.