Zack's ommon tools
Project description
zacktools
Useful tools created by zackdai
install
=======
``pip install zacktools``
or from git
``pip3 install git+https://github.com/ZackAnalysis/zacktools.git``
pageparser
----------
A tool for parse address,phone, email, facebook, twitter, linkedin,
contact link, about us link from a webpage
usage
~~~~~
::
from zacktools import pageparser
import requests
res = requests.get('http://rel8ed.to')
result = pageparser.parse(res.content)
print(result)
Note: MainAddress is an Object, and can be further extacted like:
``print(result['Mainaddress'].city)``
If want to convert to json directly, add parameters tojson=True
::
import json
result2 = pageparser.parse(res.content, tojson=True)
print(json.dumps(result2, indent=2))
{
"facebook": "https://www.facebook.com/rel8edto/",
"twitter": "https://twitter.com/rel8edto",
"instagram": "",
"linkedin": "https://www.linkedin.com/company/rel8ed-to",
"contactlink": "http://www.rel8ed.to/contact-us/",
"aboutlink": "http://www.rel8ed.to/about-us/",
"title": "Big Data Analysis Data Mining Predictive Analytics",
"email": "info@rel8ed.to",
"phone": "905.321.0466",
"Mainaddress": "1 St. Paul St., Unit A303, St. Catharines, ON L2R 7L2",
"addresses": [
"1 St. Paul St., Unit A303, St. Catharines, ON L2R 7L2"
]
}
Test it |Open In Colab|
~~~~~~~~~~~~~~~~~~~~~~~
.. |Open In Colab| image:: https://colab.research.google.com/assets/colab-badge.svg
:target: https://colab.research.google.com/drive/1aE8PeQhJym8G6I_yHVfqIuydod5tlQuQ?usp=sharing
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
zacktools-0.0.22.tar.gz
(3.2 kB
view hashes)
Built Distribution
Close
Hashes for zacktools-0.0.22-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b57cfb15e05a0b562d7bf10fc270e25a354ebd4b7b4a97a27a418994901d379a |
|
MD5 | 226518a827e831cea4ef573c90d34550 |
|
BLAKE2b-256 | e90cb759daae3723f929d1c32be4fdfbb8fa814a0b6f6ed6b4cbcd4fae86334f |