Python jupyter:无法向网站发送请求

时间:2017-09-04 12:11:48

标签: python web-scraping python-requests jupyter-notebook

我正在学习python并在Jupyter上尝试以下代码,但显示错误。

import requests
response = requests.get("https://en.wikipedia.org/wiki/main_page")

ConnectionError: HTTPSConnectionPool(host='en.wikipedia.org', port=443): Max
retries exceeded with url: /wiki/main_page (Caused by
NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at
0x7f0237dc1e80>: Failed to establish a new connection: [Errno -3] Temporary
failure in name resolution',))`

我试图找到答案,但不确定。是因为我需要处理代理还是我的电脑操作系统有问题?请帮忙。

0 个答案:

没有答案