创建会话然后传递给其他功能不起作用

时间:2019-08-30 15:22:17

标签: python python-3.x aiohttp

我想对在main函数中创建的会话进行请求,然后将其传递给帖子以进行get请求并返回源,但它不起作用

我尝试在所有位置打印数字,但似乎无法自己完成此行的请求

async with session.get('https://google.nl') as resp:
async def post(session):
    async with session.get('https://google.nl') as resp:
        return await resp.text()

async def check(line):
    while True:
        async with aiohttp.ClientSession() as session:
            print(await post(session))

我希望打印源文本,但出现0个错误

0 个答案:

没有答案