Traceback (most recent call last)

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'

待解决

posted @ 2020-05-25 18:39  九里九里  阅读(8923)  评论(0)    收藏  举报