2
我无法使lxml与美丽的汤一起工作。在osx 10.8.4上运行。要安装lxml,我没有端口安装py25-lxml并且安装正常。现在,当我尝试用美丽的汤使用LXML我得到这个错误:使用lxml与美丽的汤
Traceback (most recent call last):
File "********.py", line 13, in <module>
soup = BeautifulSoup(urllib2.urlopen(url).read(), 'lxml')
File "/Users/********/********/bs4/__init__.py", line 155, in __init__
% ",".join(features))
bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml.
Do you need to install a parser library?
不知道这是问题的一部分,但我无法使用了import lxml.etree
有没有人还有得到lxml与osx上的美丽汤一起工作?
此外,也许我可以尝试使用不同的HTML解析器。有没有人有其他解析器的建议?
如果我没有记错,我必须手动下载'lxml'在我的Mac上才能正常工作。尝试这个 – TerryA