Metadata-Version: 1.0
Name: html2data
Version: 0.3
Summary: A simple way to transform a HTML file or URL to structured data.
Home-page: http://packages.python.org/html2data
Author: Daniel Perez Rada
Author-email: daniel@zappedy.com
License: BSD
Description: A simple way to transform a HTML file or URL to structured data.  You only need to define the xpath to the element, and a function wich is going to handle the element. You can easily write XPATH using the firebug extension, copy XPATH (I recommend edit the XPATH given by firebug, making it shorter).
        For example:
        
        >>> ## start the console
        >>> from html2data import html2data
        >>> html = """<!DOCTYPE html><html lang="en"><head>
        <meta charset="utf-8" />
        <title>Example Page</title>
        <link rel="stylesheet" href="css/main.css" type="text/css" />
        </head>
        <body>
        <h1><b>Title</b></h1>
        <div class="description">This is not a valid HTML</body>
        </html>"""
        
        >>> config = {
        'map': [
        ['header_title', u'//head/title/text()', self.getOne],
        ['body_title', u'//h1/b/text()', self.getOne],
        ['description', u'//div[@class="description"]/text()', self.getOne],
        ]
        }
        
        >>> handler = html2data()
        >>> received_obj = handler.load(html = html, config=config)
        >>> print received_obj
        {'header_title': 'Example Page', 'body_title': 'Title', 'description': 'This is not a valid HTML'}
        
        
        To use it you will need:
        - lxml 2.0+
        - httplib2
Keywords: html2data html data xpath crawler transform
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Topic :: Utilities
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
