Web-Scraping 最大重试次数被拒绝
Web-Scraping Max Retries Rejected
我在抓取某些网站时遇到问题,而其他网站可以。例如,这有效:
page = requests.get('https://wsj.com/', proxies=proxydict)
但事实并非如此:
page = requests.get('https://www.privateequityinternational.com/', proxies=proxydict)
我收到 "max retries" 错误,即使我只抓取了 1 页(之前没有抓取过)。
我试过对无法抓取的网站使用 header,但没有成功。我应该使用特定的 header 吗?如何抓取上面显示的第二个网站 (www.privateequityinternational.com)?谢谢。
问题是页面在您的浏览器中通过 http 提供,而不是 https,您会收到来自 google 的警告当您尝试使用 https:
访问该页面时
In [1]: import requests
...: page = requests.get('http://www.wsj.com')
...:
In [2]: page
Out[2]: <Response [200]>
我在抓取某些网站时遇到问题,而其他网站可以。例如,这有效:
page = requests.get('https://wsj.com/', proxies=proxydict)
但事实并非如此:
page = requests.get('https://www.privateequityinternational.com/', proxies=proxydict)
我收到 "max retries" 错误,即使我只抓取了 1 页(之前没有抓取过)。
我试过对无法抓取的网站使用 header,但没有成功。我应该使用特定的 header 吗?如何抓取上面显示的第二个网站 (www.privateequityinternational.com)?谢谢。
问题是页面在您的浏览器中通过 http 提供,而不是 https,您会收到来自 google 的警告当您尝试使用 https:
访问该页面时In [1]: import requests
...: page = requests.get('http://www.wsj.com')
...:
In [2]: page
Out[2]: <Response [200]>