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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

parse_utils-1.2-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file parse_utils-1.2-py3-none-any.whl.

File metadata

  • Download URL: parse_utils-1.2-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/46.2.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8

File hashes

Hashes for parse_utils-1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 18dcfd83e3b2b1834f8164aa9c1112f875362913a58c9a35bb25e9054d2e5959
MD5 3747a33dfde95f8852f803aaec24c51f
BLAKE2b-256 883bb76babc4ed2788cc145e3ecfc8ff60e412c009e93c36fa81fc15259f64e0

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