import asyncio
import aiohttp
proxy = 'http://127.0.0.1:7890'
async def main():
async with aiohttp.ClientSession() as session:
async with session.get(url='https://www.baidu.com', proxy=proxy) as res:
print(await res.text())
if __name__ == '__main__':
asyncio.get_event_loop().run_until_complete(main())
版权归属:
海绵
许可协议:
本文使用《署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)》协议授权
评论区