Parses Open Graph meta tags of web pages and returns a handy JSON-like object. Use this to generate preview of web pages like you see on social media
Project description
opengraph_parse
Ben Jacobson 2020
Parses Open Graph meta tags of web pages. Use this to generate previews of web pages.
The purpose of this is to make it easy to scrape a pages opengraph meta tags. This is helpful if you ever want to create a preview of a web page like you'd see when you post to social media, or post a link on Slack.
Uses Python >=3.6.9
Installation
pip install opengraph_parse
Usage
from opengraph_parse import parse_page
if name== "main": # parse the page parsed_og_tags = parse_page("http://www.facebook.com", ["og:url", "og:image", ])
# result is a python dict containing the opengraph tags, simply print them out, or use a for loop to iterate over these.
for key, value in parsed_og_tags.items():
print (f"'{key}' : '{value}'")
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
Built Distribution
File details
Details for the file opengraph_parse-0.0.5.tar.gz
.
File metadata
- Download URL: opengraph_parse-0.0.5.tar.gz
- Upload date:
- Size: 2.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6190eb5ea3d483326a8dec476995b2ef0d651c99d6474278c8b91ebc00571fdd |
|
MD5 | fbd4147d048535abb2128658188514de |
|
BLAKE2b-256 | 80533b9be41075ab251bc20e3006feb2b0d0df3aa4ec2738d7cbedd1d7b1f3ba |
File details
Details for the file opengraph_parse-0.0.5-py3-none-any.whl
.
File metadata
- Download URL: opengraph_parse-0.0.5-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 242f21aa727130eeceeb54c561aa13adbe0d21bc3def95c46a677448e414895c |
|
MD5 | 48e8d413e79865aa132d2c0730593d69 |
|
BLAKE2b-256 | 07c626c584c19f09b8cf07b74cd0e36e6e4910d8d93f527829ec4d9ad68b78a4 |