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'
待解決