标签:应该 res traceback color read 输入 term ack lib
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)
标签:应该 res traceback color read 输入 term ack lib
原文地址:https://www.cnblogs.com/polipolu/p/12960251.html