1
我無法在Python3中打開一個URL。 我使用一個名爲Repl.it在線編輯器編碼(https://repl.it/languages/python3)爲什麼我無法在Python 3中打開URL?
代碼:
import urllib.request
fp = urllib.request.urlopen("http://www.python.org")
mybytes = fp.read()
print(mybytes)
錯誤:
Traceback (most recent call last):
File "python", line 2, in <module>
urllib.error.URLError: <urlopen error [Errno -2] Name or service not known>
可能的[repl.it上的lxml請求]重複(https://stackoverflow.com/questions/41162897/lxml-requests-on-repl-it) – Tomalak