Skip to main content
https://badge.fury.io/py/dhtmlparser3.png https://img.shields.io/pypi/dm/dhtmlparser3.svg https://readthedocs.org/projects/dhtmlparser3/badge/?version=latest https://img.shields.io/github/issues/Bystroushaak/dhtmlparser3.svg https://img.shields.io/pypi/l/dhtmlparser3.svg

What is it?

DHTMLParser3 is a lightweight HTML/XML parser created for one purpose - quick and easy picking selected tags from DOM.

It can be very useful when you are in need to write own “guerilla” API for some webpage, or a scrapper.

It is written in pure python with no dependencies, and it can handle pretty badly broken HTML.

Documentation

Full module documentation can be found here: http://DHTMLParser3.rtfd.org

Changelog

3.0.2

  • Added .__hash__() method for Tag.

  • .replace_with() method now accepts str as well as Tag.

  • Fixed problems with .parent setting for non-pair tags in the parser.

  • Added bunch of tests to test newly added stuff.

3.0.1

  • Added .__contains__() method for Tag, so you can now test parameters using in operator.

3.0.0

  • Rewritten to use different parser, support for HTML entities.

  • Structure of the classes completely changed, now Tag & Comment are used instead of HTMLElement.

  • Much more cleaner code and more comprehensive method names.

  • By default, the tree is now double-linked without any additional cost.

  • Implemented very useful magic methods, so indexing operators are supported for access to both parameters and content.

  • Documentation completely reworked.

  • Set of coverage tests is now much larger.

2.2.3

2.2.2

  • Attempt to fix strange recursive inheritance problem.

2.2.0

  • Rewritten for compatibility with python3.

2.1.0 - 2.1.8

  • State parser fixed - it can now recover from invalid html like <invalid tag=something">.

  • Rewritten to use StateEnum in parser for better readability.

  • Garbage collector is now disabled during _raw_split().

  • Fixed #16 - recovery after tags which don’t ends with > (</code for example).

  • Closed #17 - implementation of ignoring of < in usage as is smaller than sign.

  • Restored support of multiline attributes.

  • .parseString() now doesn’t try to parse HTML element parameters.

  • Implemented first() getter.

  • License changed to MIT.

  • Fixed #18: bug which in some cases caused invalid output.

  • Added HTMLElement.__repr__().

  • Added test_coverage.sh.

  • Added extended test_equality() coverage.

  • Formatting improvements.

  • Improved constructor handling, which is now much more readable.

  • Updated formatting of the setup.py.

  • Added more tests.

  • Fixed #22; bug in the SpecialDict.

  • Fixed some nasty unicode problems.

  • Fixed python 2 / 3 problem in docs/__init__.py.

  • getVersion() -> get_version().

2.0.10

  • Added more tests of removeTags().

  • run_tests.sh now gets arguments.

  • Check for string in removeTags() changed to basestring from str.

2.0.6 - 2.0.9

  • Fixed behaviour of toString() and tagToString().

  • SpecialDict is now derived from OrderedDict.

  • Changed and added tests of .params attribute (OrderedDict is now used).

  • Fixed bug in _repair_tags().

  • Removed _repair_tags() - it wasn’t really necessary.

  • Fixed nasty bug which could cause invalid XML output.

2.0.1 - 2.0.5

  • Fixed bugs in .match().

  • Fixed broken links in documentation.

  • Fixed bugs in .isAlmostEqual().

  • .find(); Fixed bug which prevented tag_name to be None.

  • Added op .__eq__() to the SpecialDict.

  • Added new method .containsParamSubset() to HTMLElement.

2.0.0

  • Rewritten, refactored, splitted to multiple files.

  • Added unittest coverage of almost 100% of the code.

  • Added better selector methods (.wfind(), .match)

  • Added Sphinx documentation.

  • Fixed a lot of bugs.

Metadata

Release files for DHTMLParser3 3.0.2

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

Source distribution (sdist)

Source distribution for DHTMLParser3 3.0.2
File Size Uploaded
DHTMLParser3-3.0.2.tar.gz 515.4 kB Details

Release files / DHTMLParser3-3.0.2.tar.gz

Download URL DHTMLParser3-3.0.2.tar.gz
Size 515.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2b52622bbdb41576b343f87654e9980ad9f6600ff834ac5ba3f1ea2a01eceb53
BLAKE2b-256 checksum
How to use checksums
5eb51463db2ddfaf9c1fba3c8daba69f3cab3f3cfebc197e212ec1d8855a3af3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.8

Release history Release notifications | RSS feed

3.0.17

1 release file

3.0.16

1 release file

3.0.15

1 release file

3.0.14

1 release file

3.0.13

1 release file

3.0.12

1 release file

3.0.11

1 release file

3.0.10

1 release file

3.0.9

1 release file

3.0.8

1 release file

3.0.7

1 release file

3.0.6

1 release file

3.0.5

1 release file

3.0.4

1 release file

3.0.3

1 release file

This release

3.0.2 This release

1 release file

3.0.1

1 release file

3.0.0

1 release file

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