Skip to main content

python library to detect and extract listing data from HTML page

Project description

MDR is a library detect and extract listing data from HTML page. It implemented base on the Finding and Extracting Data Records from Web Pages but change the similarity to tree alignment proposed by Web Data Extraction Based on Partial Tree Alignment and Automatic Wrapper Adaptation by Tree Edit Distance Matching.


numpy and scipy must be installed to build this package.


Detect listing data

MDR assume the data record close to the elements has most text nodes:

[1]: import requests
[2]: from mdr.mdr import MDR
[3]: mdr = MDR()
[4]: r = requests.get('')
[5]: candidates, doc = mdr.list_candidates(r.text.encode('utf8'))

[8]: [doc.getpath(c) for c in candidates[:10]]

Extract data record

MDR can find the repetiton pattern by using tree matching under certain candidate DOM tree.then it will build a mapping from so-called seed element to a list of matched elements from different DOM trees.

Used with annotation (optional)

You can annotate the seed record with any tools (e.g. scrapely) you like, then mdr will be able to find the other data in the page.

e.g. you can find this demo page here. the colored data in first row are annotated manually, the rest are extracted by MDR.


Terry Peng <>



Project details

Release history Release notifications

Download files

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

Files for mdr, version 0.0.1
Filename, size & hash File type Python version Upload date
mdr-0.0.1.tar.gz (49.3 kB) View hashes Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page