使用 python 请求模块进行网络抓取时出错

Getting error while web scraping using python requests module

正在尝试使用 python 3.6.2.Getting 抓取网站内容,出现以下错误。

requests.exceptions.SSLError: HTTPSConnectionPool(host='www.amazon.in', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, '[SSL: TLSV1_ALERT_ACCESS_DENIED] tlsv1 alert access denied
 (_ssl.c:748)'),))

代码:

import requests
from bs4 import BeautifulSoup
r=requests.get("https://www.amazon.in/")
r.content

帮我解决这个问题!

您可以通过键入以下命令检查您的连接和使用 TLS 协议通信的能力:

openssl s_client -connect www.amazon.in:443

无论如何,你的 python 代码是正确的,对我有用。

尝试 http 而不是 https。它对我有用