Traceback (most recent call last)
Posted polipolu
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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‘
待解决
以上是关于Traceback (most recent call last)的主要内容,如果未能解决你的问题,请参考以下文章
python初学者Traceback (most recent call last):
arcpy runtime error Traceback(most recent call last) 在Arcgis中写的脚本,点要素生成出错
python运行后显示Traceback (most recent call last):啥意思?
pods安装,提示报错Traceback (most recent call last):