希望解析图像的 HTML 页面(来自http://www.z-img.com),当我将页面加载到 BeautifulSoup (bs4) 中时,Python 崩溃了。“问题详细信息”显示这etree.pyd
是“故障模块名称”,这意味着它可能是一个解析错误,但到目前为止,我还不能完全确定它的原因。
这是我在 Python2.7 上可以归结为最简单的代码:
import requests, bs4
url = r"http://z-img.com/search.php?&ssg=off&size=large&q=test"
r = requests.get(url)
html = r.content
#or
#import urllib2
#html = urllib2.urlopen(url).read()
soup = bs4.BeautifulSoup(html)
在我通过 JsBeautifier.com 之后,连同 PasteBin ( http://pastebin.com/XYT9g4Lb ) 上的示例输出。