AttributeError: ‘module’ object has no attribute 'urlopen
在python3中此处的urllib都应该改成urllib.request
python NameError: name ‘raw_input’ is not defined
在python3中用input替换了raw_input
TypeError: can’t use a string pattern on a bytes-like object
在python3中应在正则表达式前应添加html = html.decode(‘utf-8’)
以上是几个用python初学爬虫时因python3和python2的区别造成的报错。