BLOG
Enjoy when you can, and endure when you must.
JUN 26, 2014/Python
Ubuntu安装lxml的小插曲
今天需要用BeautifulSoup来解析xml,于是很自然地想到了在实例化时加入features='xml'参数。不过收到了如下错误:FeatureNotFound: Couldn't find a tree builder with the features you requested: xml. Do you need to install a parser librar...
NOV 26, 2013/Python
解析XML:更优的性能
BeautifulSoup是一个很强大的HTML/XML解析工具,简单易用。不过从性能上来说,它可能并不是最好的。因此,我们考虑使用另外一个第三方包lxml,它在底层是通过C实现的,因此在速度上会有明显的优势。还是之前的例子:<?xml version="1.0" encoding="utf-8"?> <CSubmitState xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www...
1