嗨,我得到了上述錯誤。爲什麼會彈出,我錯過了什麼,我該如何解決它?謝謝AttributeError:'HTTPResponse'對象沒有屬性'替換'
try:
import urllib.request as urllib2
except ImportError:
import urllib2
from html2text import html2text
sock = html2text(urllib2.urlopen('http://www.example.com'))
htmlSource = sock.read()
sock.close()
print (htmlSource)
在Windows 7操作系統上運行IDLE 3.4.3。
現在即時得到:類型錯誤: 'STR' 不支持緩衝區接口 – user3115713