今天学习python语言爬虫知识时,遇到了困难,编译器总是报出“AttributeError",试了很多方法,还不能解决,求大神指导!!!
代码如下:
# -*- coding: utf-8 -*-
import urllib
url = "http://www.baidu.com"
html = urllib.urlopen(url)
print html.read()
编译器结果截图:
今天学习python语言爬虫知识时,遇到了困难,编译器总是报出“AttributeError",试了很多方法,还不能解决,求大神指导!!!
代码如下:
# -*- coding: utf-8 -*-
import urllib
url = "http://www.baidu.com"
html = urllib.urlopen(url)
print html.read()
编译器结果截图:
可能在你的搜索路径中有另一个string.py,尝试
看输出什么