标签:pytho dal pat obj erro htm int color object
根据所抓取的网页来修改编码, 如果网页编码是utf-8, 那就html=html.decode(‘utf-8‘)
上下文是这样的
html = ‘‘
while True:
html = loadurl(url)
if html == ‘‘:
print (‘load‘, url,‘error‘)
print (‘oppa‘)
continue
else:
break
seriesList = re.findall(reSeriesList,html.decode(‘GBK‘),re.S)
python3写爬虫报错--------TypeError: cannot use a string pattern on a bytes-like object
标签:pytho dal pat obj erro htm int color object
原文地址:http://www.cnblogs.com/AbsolutelyPerfect/p/7638639.html