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'

待解決


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM