我需要從堆棧溢出中檢索我的信息。 我想要檢索的網頁是這樣的。爲什麼urllib.urlopen不會(似乎)與堆棧溢出一起工作?
http://stackoverflow.com/users/260127/prosseek
當我運行腳本時,它似乎沒有返回任何結果。
import urllib
sock = urllib.urlopen("http://stackoverflow.com/users/260127/prosseek")
htmlSource = sock.read()
sock.close()
print htmlSource
,而我得到這個幾乎是立竿見影。
import urllib
sock = urllib.urlopen("http://diveintopython.net/")
htmlSource = sock.read()
sock.close()
print htmlSource
什麼可能是錯誤的?
PS。我不知道這應該問在MetaStackOverflow或不。
適合我... – Juliano 2010-04-15 16:08:25
你可能想要閱讀flair:http://stackoverflow.com/users/flair – SilentGhost 2010-04-15 16:11:14