urllib.error.URLError: <urlopen error EOF occurred in violation of protocol (

    科技2022-07-11  114

    from requests.adapters import HTTPAdapter from urllib3.poolmanager import PoolManager import ssl class MyAdapter(HTTPAdapter): def init_poolmanager(self, connections, maxsize, block=False): self.poolmanager = PoolManager(num_pools=connections, maxsize=maxsize, block=block, ssl_version=ssl.PROTOCOL_TLSv1)

    if name == ‘main’: s = requests.Session() s.mount(‘https://’, MyAdapter()) 自己的代码逻辑

    Processed: 0.008, SQL: 8