Skip to content
Python implementation of the Parsley language for extracting structured data from web pages
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs
examples
parslepy
tests
.gitignore
.travis.yml
CHANGELOG
LICENSE
MANIFEST
README.md
TODO.md
requirements-extra.txt
requirements.txt
run_parslepy.py
setup.cfg
setup.py
tox.ini

README.md

parslepy

Build Status

parslepy (pronounced "parsley-pie", /ˈpɑːslipaɪ/) is a Python implementation (built on top of lxml and cssselect) of the Parsley DSL for extracting structured data from web pages, as defined by Kyle Maxwell and Andrew Cantino (see Parsley's wiki for more details and original C implementation).

Kudos to Kyle Maxwell (@fizx) for coming up with this smart and easy syntax to define extracting rules.

Please note that this Parsley DSL is NOT the same as the Parsley parsing library at https://pypi.python.org/pypi/Parsley

Check out the official docs for more information on how to install and use parslepy. There is also some useful information at the parslepy Wiki

Here is an example of a parselet script that extracts the questions from StackOverflow first page:

{
    "first_page_questions(//div[contains(@class,'question-summary')])": [{
        "title": ".//h3/a",
        "tags": "div.tags",
        "votes": "div.votes div.mini-counts",
        "views": "div.views div.mini-counts",
        "answers": "div.status div.mini-counts"
    }]
}

Install

Install via pip with:

sudo pip install parslepy

Alternatively, you can install from the latest source code:

git clone https://github.com/redapple/parslepy.git
sudo python setup.py install

Online Resources

You can’t perform that action at this time.