Skip to content

Instantly share code, notes, and snippets.

@diogommartins
Last active June 8, 2020 13:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diogommartins/c39c854ba49cb08bbfa0cb333dc5f669 to your computer and use it in GitHub Desktop.
Save diogommartins/c39c854ba49cb08bbfa0cb333dc5f669 to your computer and use it in GitHub Desktop.
import asyncio
from aiohttp import ClientSession
async def get_and_print(loop):
async with ClientSession(loop=loop) as session:
async with session.get("http://www.americanas.com") as response:
print(await response.text())
loop = asyncio.get_event_loop()
loop.run_until_complete(get_and_print(loop))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment