代码如下: import aiohttp import ssl import certifi import asyncio user_agent='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36' headers={ 'user_agent':user_agent }
async def test(): async with aiohttp.ClientSession() as session: async with session.get(url='https://www.facebook.com/',headers=headers,) as response: print(await response.text()) loop=asyncio.get_event_loop() loop.run_until_complete(test()) 出现如下报错: aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host www.facebook.com:443 ssl:default [信号灯超时时间已到] 网上搜索说将 verify_ssl=Fals 或者添加 connector=aiohttp.TCPConnector(limit=50, loop=loop) 还是一样出错

