import asyncio
import aiohttp

async def fetch(session, url):
    headers = {
        "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36",
    }
    async with session.get(url, headers=headers) as resp:
        return await resp.text()


async def download(url):
    async with aiohttp.ClientSession() as session:
        resp = await fetch(session, url)
        print(resp)


urls = [f"https://www.codesou.cn?n={i}" for i in range(1, 10)]
tasks = [download(url) for url in urls]
task = asyncio.wait(tasks)
asyncio.run(task)