【发布时间】:2015-06-20 02:48:40
【问题描述】:
您好,我收到上述错误。为什么会弹出,我错过了什么以及如何解决它?谢谢
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。
【问题讨论】:
-
现在我得到 :TypeError: 'str' 不支持缓冲区接口
标签: python python-3.x httpresponse scrape