500 error with urllib.request.urlopen
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: The following code: req = urllib.request.Request(url=r"http://borel.slu.edu/cgi-bin/cc.cgi?foirm_ionchur=im&foirm=Seol&hits=1&format=xml",headers={'User-Agent':' Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0'}) handler = urllib.request.urlopen(req) is giving me the following exception: Traceback (most recent call last): File "C:/Users/Foo/lang/old/test.py", line 46, in <module> rip() File "C:/Users/Foo/lang/old/test.py", line 36, in rip handler = urllib.request.urlopen(req) File "C:\Python32\lib\urllib\request.py",