1、Python3.X出现AttributeError: module ‘urllib’ has no attribute 'urlopen’错误
pg = urllib.urlopen(searchURL) # python2x
pg = urllib.request.urlopen(searchURL) # python3x
2、module ‘urllib’ has no attribute ‘request’
因为python3.X有时候不会将子模块自动导入进去,所以改成如下
import urllib.request