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.6.tar.gz
.
File metadata
- Download URL: opengraph_parse-0.0.6.tar.gz
- Upload date:
- Size: 2.3 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 | 2707cf9d9e84493472d63906a44dd1c74fd4b2967604da17f2e5f5af7ffbe87d |
|
MD5 | 4a4bc97f1654cc6e87f2a1ba642e0273 |
|
BLAKE2b-256 | b1057036c001a9c4368147b4c103e1b5c4c27b6c9056b6b9ef0e061ec3563131 |
File details
Details for the file opengraph_parse-0.0.6-py3-none-any.whl
.
File metadata
- Download URL: opengraph_parse-0.0.6-py3-none-any.whl
- Upload date:
- Size: 4.6 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 | d0c1e8d900ef1d5d1abfd8b60a5bdbb8b7a371da7b4c51189a4498cac6aa6442 |
|
MD5 | 0ced81a4ebdcbe560ad2f24a41db77e7 |
|
BLAKE2b-256 | 9aac474497a234c0f54c5e17d7e28aeec0ac4b957778be97c4c0aab19c738bb6 |