Skip to main content

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

opengraph_parse-0.0.3.tar.gz (2.2 kB view details)

Uploaded Source

Built Distribution

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

opengraph_parse-0.0.3-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file opengraph_parse-0.0.3.tar.gz.

File metadata

  • Download URL: opengraph_parse-0.0.3.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.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.9

File hashes

Hashes for opengraph_parse-0.0.3.tar.gz
Algorithm Hash digest
SHA256 57ef35e0fe75cb8088b79c0f56386814f045b97b1b4642053218e4c1686c3527
MD5 d03d27f037b579d87cebfa418ff86c21
BLAKE2b-256 7b6c4d192550267cccf5c850f200c4d49ea849d84984eaa958941f08853fac68

See more details on using hashes here.

File details

Details for the file opengraph_parse-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: opengraph_parse-0.0.3-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.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.9

File hashes

Hashes for opengraph_parse-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ff3d0af0b5f613434a1dd8d318177e6d09919f179457530cef954d7033b348d8
MD5 007374a564ba2b227349a8bd868bcabc
BLAKE2b-256 18dee8da3ae3ea2d7222f4f4eb444cafa684ca444e46e33008cf129b0595094d

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