Going Further With lxml
We'll cover the following...
We'll cover the following...
lxml is an open source third-party library that builds on the popular libxml2 parser. It provides a 100% compatible ElementTree api, then extends it with full XPath 1.0 support and a few other niceties. There are installers available for Windows; Linux users should always try to use distribution-specific tools like yum or apt-get to install precompiled binaries from their repositories. Otherwise you’ll need to install lxml manually.
① Once imported, lxml provides the same api as the built-in ElementTree library.
② parse() function: same as ElementTree.
③ getroot() method: also the same. ...