Skip to main content

Get HTMl code from the Safari browser

Project description

Get HTML from Safari

https://img.shields.io/pypi/v/get_html_from_safari.svg https://img.shields.io/travis/sdondley/get_html_from_safari.svg Documentation Status

Description

Gets HTML code from web pages open in the Safari browser.

Usage

The get_html_from_safari package fetches the HTML source code of the currently active Safari browser tab on macOS. This package utilizes AppleScript to interact with the Safari browser and retrieve the HTML content.

Example Usage To use get_html_from_safari, follow these steps:

Install the package:

pip install get_html_from_safari

Import the package and fetch the HTML source code of the active Safari tab:

from get_html_from_safari import get_html
html_content = get_html()

You can now process the retrieved HTML content as needed.

To fetch the HTML source code of a specific URL, pass the URL as an argument:

from get_html_from_safari import get_html
url = "https://www.example.com"
html_content = get_html(url)

This will open up a new browser window and fetch the HTML source code of the url specified.

Please note that this package is specifically designed for macOS and the Safari browser. It will not work with other operating systems or web browsers.

From the command line:

$ html-source-get <url>

Requirements

  • Python 3.6 or higher

  • macOS

Features

Contains an entry point html-source-get <url>.

If no url is supplied, it will get the HTML code from the current Safari tab. If a url is supplied, it will open a new tab and get the HTML code from that tab.

The HTML code is dumped directly to the terminal.

License

  • Free software: Apache Software License 2.0

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

0.1.0 (2023-04-05)

  • First release on PyPI.

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

get_html_from_safari-0.2.3.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

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

get_html_from_safari-0.2.3-py2.py3-none-any.whl (7.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file get_html_from_safari-0.2.3.tar.gz.

File metadata

  • Download URL: get_html_from_safari-0.2.3.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for get_html_from_safari-0.2.3.tar.gz
Algorithm Hash digest
SHA256 5a7b64cce63166713c16eb82639ccee1d4a4bbced4ee0de53842db84b1f2096b
MD5 87ba65fef53f59e02db762263f4635da
BLAKE2b-256 ccaa32a6dc3bf32f6177e357324103e59a09fe41fb7fd71eac1b8f7880d1f0b4

See more details on using hashes here.

File details

Details for the file get_html_from_safari-0.2.3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for get_html_from_safari-0.2.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 3ee843d59c345e8868d3e1c42746ec5e50a58640e8325a29c47efca2c5e736cc
MD5 2376255cf231cdccc58d59ef27e7a2a1
BLAKE2b-256 ac75d323fc5af2ac72a4fd05e634ece496ed5b3cc8a40dfc691da9d6dc38a181

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