Last active
June 8, 2020 13:48
-
-
Save diogommartins/c39c854ba49cb08bbfa0cb333dc5f669 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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