【发布时间】:2022-01-15 11:48:58
【问题描述】:
使用 google-search 包 (https://pypi.org/project/googlesearch-python/) 直接从 cmd 打开几个 google 搜索结果。前几天工作正常。 现在尝试启动代码我得到 SSL: WRONG_VERSION_NUMBER 错误
任何想法如何解决?如果有想法是什么导致了错误,那会很有趣。
代码:
from googlesearch import search
import webbrowser, sys
searching_for = input(("Input search words: "))
num_results = int(input("How many results : ") or "3")
result = search(searching_for)
for i in result[:num_results]:
webbrowser.open(i)
错误 引发 ProxyError(e, request=request) requests.exceptions.ProxyError: HTTPSConnectionPool(host='www.google.com', port=443): Max retries exceeded with url: /search?q=tim+ferriss&num=11&hl=en (由 ProxyError('你的代理出现要仅使用 HTTP 而不是 HTTPS,请尝试将您的代理 URL 更改为 HTTP。请参阅:https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#https-proxy-error-http-proxy', SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] 错误版本号 (_ssl.c:997)'))))
【问题讨论】:
标签: python ssl web-scraping