async with aiohttp.ClientSession() as session:
async with session.get('http://python.org') as response:
print("Status:", response.status)
print("Content-type:", response.headers['content-type'])
html = await response.text()
print("Body:", html[:15], "...")
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
Error:
DeprecationWarning: There is no current event loop
loop = asyncio.get_event_loop()
asyncio.run(main())
[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired
Обсуждают сегодня