首页 > 其他 > 详细

Traceback (most recent call last)

时间:2020-05-25 18:51:17      阅读:61      评论:0      收藏:0      [点我收藏+]

1.AttributeError: module ‘urllib.response‘ has no attribute ‘read‘

代码:

res=urllib.response.read().decode(UTF-8)#读取网页内容,用utf-8解码成字节

  1) python3中应该

    import urllib.request

  2)代码改为

res=response.read().decode(UTF-8)#读取网页内容,用utf-8解码成字节

————————————————————————————————————————————————

2.bs4.FeatureNotFound: Couldn‘t find a tree builder with the features you requested: lxml.

代码:

soup=BeautifulSoup(res,lxml)

代码没问题,需要下lxml

termin输入

pip install lxml

下载lxml

————————————————————————————————

3.NoneType‘ object has no attribute ‘find_next‘

待解决

Traceback (most recent call last)

原文:https://www.cnblogs.com/polipolu/p/12960251.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!