Traceback (most recent call last):
File "G:/PyCharm/workspace/baike_spider/spider_main.py", line 45, in <module>
obj_spider.craw(root_url)
File "G:/PyCharm/workspace/baike_spider/spider_main.py", line 27, in craw
html_cont = self.downloader.download(new_url)
File "G:\PyCharm\workspace\baike_spider\html_downloader.py", line 14, in download
response = urllib.request.urlopen(url)
File "G:\Python36\lib\urllib\request.py", line 223, in urlopen
craw 1 : <bound method UrlManager.get_new_url of <url_manager.UrlManager object at 0x000001BDA7F82A58>>
return opener.open(url, data, timeout)
File "G:\Python36\lib\urllib\request.py", line 517, in open
req.timeout = timeout
AttributeError: 'method' object has no attribute 'timeout'
Process finished with exit code 1
上面是错误信息 下面是它说出错的地方。最后两个定位在 request模块里 让我有点懵逼