>>> import asyncio
>>> import httpx
>>>
>>> urls = [
... 'https://python3.info/index.html',
... 'https://python3.info/LICENSE.html',
... 'https://python3.info/about/versions.html',
... 'https://python3.info/about/references.html',
... 'https://python3.info/about/history.html',
... 'https://python3.info/about/links.html',
... ]
>>>
>>>
>>> async def fetch(url):
... print(f'fetch before: {url}')
... async with httpx.AsyncClient() as client:
... response = await client.get(url)
... print(f'fetch after: {url}')
... return response.text
>>>
>>>
>>> async def main():
... async with asyncio.TaskGroup() as group:
... for url in urls:
... group.create_task(fetch(url))
>>>
>>>
>>> asyncio.run(main())