我一直在試圖用repl.it來做到這一點,並嘗試過在這個網站上的幾個解決方案,但他們都沒有工作。現在,我的代碼看起來像如何獲取使用Python 3的網站的HTML?
import urllib
url = "http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing=12345"
print (urllib.urlopen(url).read())
但它只是說「AttributeError:模塊'urllib'沒有屬性'urlopen'」。
如果我添加導入urllib.urlopen,它告訴我沒有名稱的模塊。我該如何解決我的問題?
請參閱http://stackoverflow.com/a/25863131/4895040 – raymelfrancisco
可能的重複http://stackoverflow.com/questions/3969726/attributeerror-module-object-has-no-attribute-urlopen – Joe
可能的重複[Python的urllib urlopen不工作](http://stackoverflow.com/questions/25863101/python-urllib-urlopen-not-working) – zondo