python2.7默认的编码方式为ascii码,如下可以查询: import sys sys.getdefaultencoding() 如果直接在unicode和ascii字符串之间做计算.比较.连接,都会出错: s = '您好' u = u'您好' s == u __main__:1: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them…
from selenium import webdriver def finds(da): d = da.split(',"') t = {} for i in (d[1], d[2], d[3]): tem = i.split('":') t[tem[0].replace('"', '').strip()] = tem[1].replace('"', '').strip() return t dr = webdriver.Ie() url = u'http://w…