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
Release history Release notifications | RSS feed
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-0.2.tar.gz
(2.0 kB
view details)
File details
Details for the file parse-utils-0.2.tar.gz.
File metadata
- Download URL: parse-utils-0.2.tar.gz
- Upload date:
- Size: 2.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc8eda5e252f0bf6dfa6f18dd604783c87ecaeff666bcab48ee67aa1f9bbb561
|
|
| MD5 |
e4c8b8fc3d72fb598dcf9f52d7d899bf
|
|
| BLAKE2b-256 |
03d507ee9faa24e831cc555dc1debdbaa2b95c745e09aba55039933692a6ded0
|