Skip to main content

Python HTML/XML parser for simple web scraping.

Project description

What is it?

DHTMLParser 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.

If you want, you can also create HTML/XML documents more easily than by joining strings.

Documentation

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

Changelog

2.1.3

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

2.1.2

  • Restored support of multiline attributes.

2.1.1

  • 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.

2.1.0

  • 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().

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyDHTMLParser-2.1.3.tar.gz (418.3 kB view details)

Uploaded Source

File details

Details for the file pyDHTMLParser-2.1.3.tar.gz.

File metadata

File hashes

Hashes for pyDHTMLParser-2.1.3.tar.gz
Algorithm Hash digest
SHA256 a225708e7b4afbb1d94ca3fac4d12656d37232d2be9883102efa3dd812c407bf
MD5 c58f9d27b6dc2bc4c5c055f814255c7b
BLAKE2b-256 aec5db5c758087be6a80faa2ce159362bd0fc34d24cd74d64504d532ee0ff00a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page