1、报错:
import urllib2
url = u"http://www.baidu.com/wd=测试"
urllib2.urlopen(url).read()
错误如下:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
r[......]
Python使用urllib2打开含有unicode(中文)的url时报错的问题。
Leave a reply