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

  • Fixed nasty bug which could cause invalid XML output.

2.0.8

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

2.0.7

  • Fixed bug in _repair_tags().

2.0.6

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

  • SpecialDict is now derived from OrderedDict.

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

2.0.5

  • Added new method .containsParamSubset() to HTMLElement.

2.0.4

  • Added op .__eq__() to the SpecialDict.

2.0.3

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

2.0.2

  • Fixed bugs in .isAlmostEqual().

2.0.1

  • Fixed bugs in .match().

  • Fixed broken links in documentation.

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.0.tar.gz (417.8 kB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for pyDHTMLParser-2.1.0.tar.gz
Algorithm Hash digest
SHA256 cc65e7500ed421f3788c603bd97f3c8943c707bf106b00d50c0c022680693cbe
MD5 0b74479e980d9b3b2079c2d6904d507d
BLAKE2b-256 cf1b2a9384eeed71785885716bb747fa425748cfb2983e4a414c8b2a73efd186

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