Skip to main content

A simple Selenium-based webpage fetcher for fully rendered HTML

Project description

Introduction

load_url is a lightweight Python utility that automates webpage loading and HTML extraction using Selenium. It waits for a specific CSS class to appear on the page—ensuring the content is fully rendered—before saving the final HTML to a file. This makes it ideal for scraping dynamic sites, debugging frontend rendering, or capturing snapshots of JavaScript-heavy pages. The tool supports headless mode for background usage and works seamlessly with Firefox through Geckodriver.

Features

  • Loads webpages using selenium
  • Waits for the specified class to load before fetching the webpage
  • saves the enitre rendered HTML to the specified file location
  • Supports Headless mode so to open and read the page in an invisible NON UI browser to save on Memory and Graphic Resources

Installation

jnstall using the following pip command:

pip install bel-webpage-class-fetcher

Requirements

  • python 3.7+
  • firefox
  • geckodriver
  • INTERNET (!!!)
  • Highly Reccomended to use Virtual Enviornment

Usage

  • import the library using
from bel_webpage_class_fetcher import load_url

Parameters:

url: str -> The URL of the webpage to be loaded
wait_for_class -> the name of the class to wait for to load before downloading
output_file_name: str -> the filepath where the HTML will be stored
driver_path: str -> the path to the geckodriver (recommend full path)
headless: bool -> flag to specify wheather to opne the browser window or not

Example Output

~ Imagine a fully rendered HTML page~

Troubleshooting

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

bel_webpage_class_fetcher-0.0.2.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

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

bel_webpage_class_fetcher-0.0.2-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file bel_webpage_class_fetcher-0.0.2.tar.gz.

File metadata

File hashes

Hashes for bel_webpage_class_fetcher-0.0.2.tar.gz
Algorithm Hash digest
SHA256 d7cbe8696028b27cfcf3b4c5e91b3e3ef32b4694a022d346eace9d7647ddc382
MD5 dedf236b151fc4959362f4c0837bef5e
BLAKE2b-256 90655025b50b918386c1dbbd3ae7e3b0a8f00e7c378285ab4d8a5c1deeb963f0

See more details on using hashes here.

File details

Details for the file bel_webpage_class_fetcher-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for bel_webpage_class_fetcher-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7f32e2d78bb3a1f605044a72fcc58d1724147039e72baa409763120416b124ca
MD5 1d750113d75702eb5476d4537c5646fb
BLAKE2b-256 6d9cdeefa9a6f013ad75b4245074093ceeecf4b333e14b6ccd9bbcccc627f6e6

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