当我把它粘贴到浏览器上时,下面的操作可以正常工作:
http://www.somesite.com/details.pl?urn=2344
但是当我尝试用 Python 阅读 URL 时,什么也没有发生:
link = 'http://www.somesite.com/details.pl?urn=2344'
f = urllib.urlopen(link)
myfile = f.readline()
print myfile
Do I need to encode the URL, or is there something I'm not seeing?