Skip to main content

Fetch a header info from header tag in HTML file.

Project description

Overview

Fetch a header info from header tag in HTML file. This package is in development. It only correspond to title tag.

It returns a json object like this.


{

    'status': '<status>',

    'message': '<message>',

    'title': '<title>',

    'query': '<query>'

}

for example a successful case will be


{

    'status': 'OK',

    'message': 'fetching title success.',

    'title': 'Example Domain',

    'query': 'https://example.com'

}

and a bad case will be


{

    'status': 'ERR',

    'message': 'Invalid URL 'example.com': No schema supplied. Perhaps you meant http://example.com?',

    'title': None,

    'query': 'example.com'

}

The bad case returns an error code because the query is 'example.com', you should type 'https://example.com'.

Usage

from fetch_info import fetch_header



url = 'https://example.com'

fetch_header.fetch_title(url)

This software is released under the MIT License, see LICENSE.

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

fetchhtmlinfo-0.0.7.tar.gz (3.1 kB view details)

Uploaded Source

File details

Details for the file fetchhtmlinfo-0.0.7.tar.gz.

File metadata

  • Download URL: fetchhtmlinfo-0.0.7.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for fetchhtmlinfo-0.0.7.tar.gz
Algorithm Hash digest
SHA256 a4a490e9805922d04cbab16b26ea0425c8dd0f898a8823256bc6bee45e127770
MD5 b4c3214e3f2de2660a74792b8b791265
BLAKE2b-256 325c7ec52e07b8a33a526c5eb5c55178660fe2c6605b0f140e56f7b62ab68025

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