Skip to main content

Page Parser Utils For scraping, List index update

Project description

Parse Utilities (ParseUtils)

This is a package helps you extracting python dict from html/xml contents

Installation

pip install parse-utils

Usage

from parse_utils.page_parser import PageParser
html_data = '''
<html>
    <head><title>This is title</title></head>
    <body>
        <p id="header">This is header id</p>
        <p class="content">This is content</p>
    </body>
</html>
'''
config = {
    'header': ['//p[@id="header"]/text()'],
    'content': ['//p[@class="content"]'],
}
pparser = PageParser(html_data)
item = pparser.extract_dict(config)
print(item)

Output will be:

{'header': 'This is header id', 'content': 'This is content'}

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

parse-utils-1.1.tar.gz (2.2 kB view details)

Uploaded Source

File details

Details for the file parse-utils-1.1.tar.gz.

File metadata

  • Download URL: parse-utils-1.1.tar.gz
  • Upload date:
  • Size: 2.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.9

File hashes

Hashes for parse-utils-1.1.tar.gz
Algorithm Hash digest
SHA256 2474ca59200b9196481a28573e0550d0834b33e71b58e6649505b78843736e00
MD5 3048fb781589a6e16f0b45750f55d298
BLAKE2b-256 dbd6aac8a30ca56839abd379de2709e2ce220ab2d88277cbc72c7e021a5f762d

See more details on using hashes here.

Supported by

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