【发布时间】:2020-11-03 06:11:20
【问题描述】:
我正在尝试通过 jupyter 中的 py 从这个 url 抓取图像:https://www.adobe.com/products/catalog.html?sort=name&types=pf_252Fdesktop&types=pf_252Fmobile&types=pf_252Fweb&page=1,但是当运行下面的代码时,我得到了这个错误:
import requests from bs4
import BeautifulSoup
# download page page = "adobe.com/products/…" result = requests.get(page)
# if successful parse the download into a BeautifulSoup object, which allows easy manipulation
if result.status_code == 200: soup = BeautifulSoup(result.content, "html.parser")
Error: SSLError: HTTPSConnectionPool(host='www.adobe.com', port=443): Max retries exceeded with url: /products/catalog.html?sort=name&types=pf_252Fdesktop&types=pf_252Fmobile&types=pf_252Fweb&page=1 (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])")))
关于修复错误的任何建议是什么根本问题? 谢谢
【问题讨论】:
-
如果您提供一些示例代码来说明您当前如何尝试实现这一目标,将会有所帮助。它无法正确建立 SSL 连接,但没有任何代码,我们无法帮助调试。您可能还需要确保此活动确实遵循 robots.txt 和任何版权。
-
谢谢,这是我目前的代码: import requests from bs4 import BeautifulSoup # download page page = "adobe.com/products/…" result = requests.get(page) # 如果成功,将下载解析成 BeautifulSoup对象,如果 result.status_code == 200 则允许轻松操作:soup = BeautifulSoup(result.content, "html.parser")
标签: python html image web-scraping