我跑Python的这个脚本:无法建立新的连接:[错误-2]产品名称或服务不知道
import requests
url = "http://finance.yahoo.com/quote/AAPL?p=AAPL"
response = requests.get(url)
print(response)
,我发现了以下错误:
Traceback (most recent call last):
File "python", line 6, in <module>
requests.exceptions.ConnectionError: HTTPConnectionPool(host='finance.yahoo.com', port=80): Max retries exceeded with url: /quote/AAPL?p=AAPL (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7fcbf36d3a20>: Failed to establish a new connection: [Errno -2] Name or service not known',))
可能是什么原因?
谢谢
您是否尝试过使用“https”? –
是的,我得到了同样的错误 – Amit