Skip to main content

Scrape only the content from a webpage using Firefox's reader view.

Project description

Webpage Content Scraper

PyPI Tests Changelog License

Scrape only the content from a webpage using Firefox's reader view.

Installation

Install this library using pip:

pip install webpage-content-scraper

Then install the Firefox browser for Playwright:

playwright install firefox

Usage

Simply supply a URL and optionally, a format and timeout.

from webpage_content_scraper import fetch_page_content, Formats

url = 'https://microsoft.github.io/autogen/blog/2023/10/18/RetrieveChat/'

html_content = fetch_page_content(url)
markdown_content = fetch_page_content(url, Formats.MARKDOWN)

Development

To contribute to this library, first checkout the code. Then create a new virtual environment:

cd python-webpage-content-scraper
python -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

pip install -e '.[test]'

To run the tests:

pytest

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

webpage_content_scraper-0.1.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

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

webpage_content_scraper-0.1-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file webpage_content_scraper-0.1.tar.gz.

File metadata

  • Download URL: webpage_content_scraper-0.1.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for webpage_content_scraper-0.1.tar.gz
Algorithm Hash digest
SHA256 df56c15bf95d0c568feba1d6245ef574f675e7110027fa0a22c6026406b9c2d3
MD5 ba0937d504aafb5519d557ad511c04cb
BLAKE2b-256 b1938fbe0831ef567cee0dfaedf69e5fcb262b71b6b54dc780e552a3481a8b17

See more details on using hashes here.

File details

Details for the file webpage_content_scraper-0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for webpage_content_scraper-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bfe80d8a74086caa3577d6da98f9536868d874460ff9a95e0304cbab9d6b4989
MD5 de8a9aab67f7e143b59b6d974a116a3b
BLAKE2b-256 ba88f02147d27f46a2f3ad4557330155d722deedf8469157ac8e029a685e8a50

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