已有184人关注
快速示例5.13运行时出错
发表在Python图书答疑 2021-02-15 《Python网络爬虫从入门到实践》第5章 请求模块requests 94页-0页
是否精华
版块置顶:

Traceback (most recent call last):

  File "C:\Python\Python37-32\lib\site-packages\urllib3\connectionpool.py", line 600, in urlopen

    chunked=chunked)

  File "C:\Python\Python37-32\lib\site-packages\urllib3\connectionpool.py", line 343, in _make_request

    self._validate_conn(conn)

  File "C:\Python\Python37-32\lib\site-packages\urllib3\connectionpool.py", line 849, in _validate_conn

    conn.connect()

  File "C:\Python\Python37-32\lib\site-packages\urllib3\connection.py", line 356, in connect

    ssl_context=context)

  File "C:\Python\Python37-32\lib\site-packages\urllib3\util\ssl_.py", line 359, in ssl_wrap_socket

    return context.wrap_socket(sock, server_hostname=server_hostname)

  File "C:\Python\Python37-32\lib\ssl.py", line 423, in wrap_socket

    session=session

  File "C:\Python\Python37-32\lib\ssl.py", line 870, in _create

    self.do_handshake()

  File "C:\Python\Python37-32\lib\ssl.py", line 1139, in do_handshake

    self._sslobj.do_handshake()

ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

  File "C:\Python\Python37-32\lib\site-packages\requests\adapters.py", line 449, in send

    timeout=timeout

  File "C:\Python\Python37-32\lib\site-packages\urllib3\connectionpool.py", line 638, in urlopen

    _stacktrace=sys.exc_info()[2])

  File "C:\Python\Python37-32\lib\site-packages\urllib3\util\retry.py", line 398, in increment

    raise MaxRetryError(_pool, url, error or ResponseError(cause))

urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.dieniao.com', port=443): Max retries exceeded with url: /FreeProxy/1.html (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)')))


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

  File "D:/Code1/05/13/demo.py", line 29, in <module>

    get_ip(url,headers)

  File "D:/Code1/05/13/demo.py", line 9, in get_ip

    response = requests.get(url,headers=headers)

  File "C:\Python\Python37-32\lib\site-packages\requests\api.py", line 76, in get

    return request('get', url, params=params, **kwargs)

  File "C:\Python\Python37-32\lib\site-packages\requests\api.py", line 61, in request

    return session.request(method=method, url=url, **kwargs)

  File "C:\Python\Python37-32\lib\site-packages\requests\sessions.py", line 530, in request

    resp = self.send(prep, **send_kwargs)

  File "C:\Python\Python37-32\lib\site-packages\requests\sessions.py", line 643, in send

    r = adapter.send(request, **kwargs)

  File "C:\Python\Python37-32\lib\site-packages\requests\adapters.py", line 514, in send

    raise SSLError(e, request=request)

requests.exceptions.SSLError: HTTPSConnectionPool(host='www.dieniao.com', port=443): Max retries exceeded with url: /FreeProxy/1.html (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)')))


分享到:
手机同步功能介绍
友情提示:以下图书配套资源能够实现手机同步功能
明日微信公众号
明日之星 明日之星编程特训营
客服热线(每日9:00-17:00)
400 675 1066
mingrisoft@mingrisoft.com
吉林省明日科技有限公司Copyright ©2007-2022,mingrisoft.com, All Rights Reserved长春市北湖科技开发区盛北大街3333号长春北湖科技园项目一期A10号楼四、五层
吉ICP备10002740号-2吉公网安备22010202000132经营性网站备案信息 营业执照