web抓取时平台不安全警告

2024-10-01 07:48:42 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用Python2.7.6从不同的站点获取数据,但是有些站点给出了insecurePlateformWarning,并且拒绝给出它们的数据。我想知道如何删除警告。你知道吗


Tags: 数据警告站点insecureplateformwarning
1条回答
网友
1楼 · 发布于 2024-10-01 07:48:42

urllib3documentation page显式建议您在insecurePlateformWarning的情况下执行以下操作之一

  • upgrade to a newer Python version
  • upgrade ndg-httpsclient with pip install upgrade ndg-httpsclient
  • use pyOpenSSL as described in the OpenSSL / PyOpenSSL section

您使用的是python2.7.6,因此我猜第一项可能适用于这里。在同一页中,请参见:

Certain Python platforms (specifically, versions of Python earlier than 2.7.9) have restrictions in their ssl module that limit the configuration that urllib3 can apply.

简而言之,您至少应该尝试升级到python2.7.9,或者升级ndg-httpsclient,如前所述。你知道吗

相关问题 更多 >