File size: 317 Bytes
3a05423
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
import aiohttp
import asyncio

async def fetch_page(url):
    async with aiohttp.ClientSession() as session:
        async with session.get(url) as response:
            print(response.status)
            return response.status

loop = asyncio.get_event_loop()
loop.run_until_complete(fetch_page('http://google.com'))