很感谢慕课这个平台,更感谢这位乒乓球老师,讲解的简洁明了,虽然出了不少问题,但还是成功运行了,第一个python程序,谢谢!
2016-10-26
File "E:\python\projectexam\baike\spider_main.py", line 32, in <module>
obj_spider.craw(root_url)
File "E:\python\projectexam\baike\spider_main.py", line 13, in craw
while self.urls.has_new_url():
AttributeError: 'SpiderMain' object has no attribute 'urls'
obj_spider.craw(root_url)
File "E:\python\projectexam\baike\spider_main.py", line 13, in craw
while self.urls.has_new_url():
AttributeError: 'SpiderMain' object has no attribute 'urls'
2016-10-22
import urllib.request
url = 'http://www.baidu.com'
print('第一种方法')
response1 = urllib.request.urlopen(url)
print(response1,getcode())
print(len(response1))
url = 'http://www.baidu.com'
print('第一种方法')
response1 = urllib.request.urlopen(url)
print(response1,getcode())
print(len(response1))
2016-10-21