Skip to main content

lxml is a Pythonic, mature binding for the libxml2 and libxslt libraries. It provides safe and convenient access to these libraries using the ElementTree API.

It extends the ElementTree API significantly to offer support for XPath, RelaxNG, XML Schema, XSLT, C14N and much more.

To contact the project, go to the project home page or see our bug tracker at https://launchpad.net/lxml

In case you want to use the current in-development version of lxml, you can get it from the github repository at https://github.com/lxml/lxml . Note that this requires Cython to build the sources, see the build instructions on the project home page. To the same end, running easy_install lxml==dev will install lxml from https://github.com/lxml/lxml/tarball/master#egg=lxml-dev if you have an appropriate version of Cython installed.

After an official release of a new stable series, bug fixes may become available at https://github.com/lxml/lxml/tree/lxml-2.3 . Running easy_install lxml==2.3bugfix will install the unreleased branch state from https://github.com/lxml/lxml/tarball/lxml-2.3#egg=lxml-2.3bugfix as soon as a maintenance branch has been established. Note that this requires Cython to be installed at an appropriate version for the build.

2.3.1 (2011-09-25)

Features added

  • New option kill_tags in lxml.html.clean to remove specific tags and their content (i.e. their whole subtree).

  • pi.get() and pi.attrib on processing instructions to parse pseudo-attributes from the text content of processing instructions.

  • lxml.get_include() returns a list of include paths that can be used to compile external C code against lxml.etree. This is specifically required for statically linked lxml builds when code needs to compile against the exact same header file versions as lxml itself.

  • Resolver.resolve_file() takes an additional option close_file that configures if the file(-like) object will be closed after reading or not. By default, the file will be closed, as the user is not expected to keep a reference to it.

Bugs fixed

  • HTML cleaning didn’t remove ‘data:’ links.

  • The html5lib parser integration now uses the ‘official’ implementation in html5lib itself, which makes it work with newer releases of the library.

  • In lxml.sax, endElementNS() could incorrectly reject a plain tag name when the corresponding start event inferred the same plain tag name to be in the default namespace.

  • When an open file-like object is passed into parse() or iterparse(), the parser will no longer close it after use. This reverts a change in lxml 2.3 where all files would be closed. It is the users responsibility to properly close the file(-like) object, also in error cases.

  • Assertion error in lxml.html.cleaner when discarding top-level elements.

  • In lxml.cssselect, use the xpath ‘A//B’ (short for ‘A/descendant-or-self::node()/B’) instead of ‘A/descendant::B’ for the css descendant selector (‘A B’). This makes a few edge cases to be consistent with the selector behavior in WebKit and Firefox, and makes more css expressions valid location paths (for use in xsl:template match).

  • In lxml.html, non-selected <option> tags no longer show up in the collected form values.

  • Adding/removing <option> values to/from a multiple select form field properly selects them and unselects them.

Other changes

  • Static builds can specify the download directory with the --download-dir option.

Release files for lxml 2.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lxml 2.3.1
File Size Uploaded
lxml-2.3.1.tar.gz 3.1 MB Details

Release files / lxml-2.3.1.tar.gz

Download URL lxml-2.3.1.tar.gz
Size 3.1 MB
Tags Source
SHA-256 checksum
How to use checksums
d5fc97bc9f4d0d0c8a73dcfcfb6fb2fe20d4da673e426ed594670a83e1485dc5
BLAKE2b-256 checksum
How to use checksums
d97bb5b86037e804cdbd7c71903042454d05acd0be5ab668fa3a2100f786b100
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

6.0.0

94 release files

5.1.1

73 release files

5.0.2

81 release files

5.0.0

88 release files

4.9.4

93 release files

4.9.2

77 release files

4.9.0

63 release files

4.8.0

61 release files

4.7.1

60 release files

4.6.5

60 release files

4.6.3

48 release files

4.6.2

37 release files

4.6.1

37 release files

4.6.0

36 release files

4.5.1

27 release files

4.5.0

27 release files

4.4.3

27 release files

4.4.2

26 release files

4.4.1

26 release files

4.4.0

22 release files

4.3.5

24 release files

4.3.4

24 release files

4.3.3

26 release files

4.3.2

26 release files

4.2.5

30 release files

4.2.3

26 release files

4.2.2

27 release files

4.2.1

28 release files

4.2.0

28 release files

4.1.0

28 release files

4.0.0

28 release files

3.7.3

22 release files

3.7.1

16 release files

3.7.0

9 release files

3.6.4

14 release files

3.6.3

14 release files

3.6.2

9 release files

3.6.1

9 release files

3.6.0

21 release files

3.5.0

16 release files

3.4.4

16 release files

3.4.3

11 release files

3.4.1

16 release files

3.4.0

16 release files

3.3.6

16 release files

3.3.5

16 release files

3.3.2

11 release files

3.3.1

11 release files

3.3.0

1 release file

3.2.3

11 release files

3.2.2

11 release files

3.2.1

11 release files

3.2.0

11 release files

3.1.2

11 release files

3.1.1

11 release files

3.1.0

11 release files

3.0.2

6 release files

3.0

6 release files

2.3.6

1 release file

2.3.5

1 release file

2.3.4

1 release file

2.3.3

1 release file

2.3.2

1 release file

This release

2.3.1 This release

1 release file

2.3

22 release files

2.2.7

5 release files

2.2.6

9 release files

2.2.5

1 release file

2.2.4

17 release files

2.2.3

1 release file

2.2.2

16 release files

2.2

9 release files

2.1.5

7 release files

2.1.4

7 release files

2.1.3

7 release files

2.1.2

7 release files

2.1.1

7 release files

2.1

7 release files

2.0.11

7 release files

2.0.10

7 release files

2.0.9

7 release files

2.0.8

7 release files

2.0.7

5 release files

2.0.6

5 release files

2.0.5

5 release files

2.0.4

5 release files

2.0

5 release files

1.3.6

5 release files

1.3.5

1 release file

1.3.4

5 release files

1.3.3

5 release files

1.3.2

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page