下面的作品,當我將其粘貼在瀏覽器上:如何使用Python讀取URL的內容?
http://www.somesite.com/details.pl?urn=2344
但是當我嘗試讀取URL使用Python什麼也沒有發生:
link = 'http://www.somesite.com/details.pl?urn=2344'
f = urllib.urlopen(link)
myfile = f.readline()
print myfile
我需要編碼的URL,或者是有我沒有看到的東西?
感謝我改成了閱讀(),而該訣竅 – 2013-02-28 17:14:34
@HelenNeely享受你的編程旅程 – woozyking 2013-02-28 17:51:11
感謝鏈接到'請求'庫 - 像抽象那裏 – 2015-02-04 13:29:43