没有收到来自HTTPS站点的响应使用请求modu

2024-05-23 16:59:19 发布

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

我正试图进入

https://www.exploit-db.com/remote

使用python的请求模块,但是没有从page获得响应。我想访问以上页面的所有链接。在

^{pr2}$

我得到的答复是:

C:\Python27\requests\packages\urllib3\connectionpool.py:791: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html
  InsecureRequestWarning)

Tags: 模块httpscomdbremoteis链接www
1条回答
网友
1楼 · 发布于 2024-05-23 16:59:19

该站点使用防火墙来查找“脚本化”访问。只需设置一个User-Agent头就可以了;值Mozilla/5.0就足够了:

headers = {'User-Agent': 'Mozilla/5.0'}
response = requests.get('https://www.exploit-db.com/remote', headers=headers, verify=False)

注意,结果页面没有前缀为download的url;只有https://www.exploit-db.com/download作为前缀。请调整您的^=前缀匹配,或者使用*=download。在

相关问题 更多 >