8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e02daac commit cb0669cCopy full SHA for cb0669c
section12/projects/async_scraping/samples/0_first_async_request.py
@@ -0,0 +1,11 @@
1
+import aiohttp
2
+import asyncio
3
+
4
+async def fetch_page(url):
5
+ async with aiohttp.ClientSession() as session:
6
+ async with session.get(url) as response:
7
+ print(response.status)
8
+ return response.status
9
10
+loop = asyncio.get_event_loop()
11
+loop.run_until_complete(fetch_page('http://google.com'))
0 commit comments