为了账号安全,请及时绑定邮箱和手机立即绑定

有一些模块好像和老师的不一样,是不是我用错了 求大神赐教

/ 猿问

有一些模块好像和老师的不一样,是不是我用错了 求大神赐教

supbad 2019-01-17 11:19:59

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模块里  让我有点懵逼

https://img4.mukewang.com/5c3ff2f00001ac5006510170.jpg

https://img2.mukewang.com/5c3ff3210001df7207820265.jpg

https://img4.mukewang.com/5c3ff33e0001831b05610247.jpg

https://img2.mukewang.com/5c3ff38c000111fd06270369.jpg

https://img1.mukewang.com/5c3ff3a50001484d07560246.jpg


查看完整描述

目前暂无任何回答

添加回答

回复

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信