Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Webpage Auto Refresher

A Python command line tool that opens a webpage in a real browser and automatically refreshes it every N seconds, where N is a value you specify.

The tool is built with Selenium (https://www.selenium.dev/), so it controls an actual Chrome or Firefox window rather than issuing background HTTP requests. This allows it to work on pages that require a logged in session or that load content dynamically through JavaScript.

Features

  1. Configurable refresh interval, specified in seconds
  2. Compatible with both Chrome and Firefox
  3. Optional limit on the number of refreshes, or continuous operation until manually stopped
  4. Automatic download of the correct browser driver through webdriver manager, requiring no manual driver setup

Installation

git clone https://github.com/DevAshish9090/webpage-auto-refresher.git
cd webpage-auto-refresher
pip install -r requirements.txt

Chrome or Firefox must be installed on the machine running the script. The matching driver is downloaded automatically on first run.

Usage

python auto_refresher.py --url <URL> --interval <SECONDS>

Examples

Refresh a page every 30 seconds.

python auto_refresher.py -u https://example.com -i 30

Refresh every 10 seconds using Firefox.

python auto_refresher.py -u example.com -i 10 -b firefox

Refresh every 5 seconds and stop automatically after 20 refreshes.

python auto_refresher.py -u https://example.com -i 5 -n 20

Command Line Options

  1. -u, --url: URL of the page to refresh. Required.
  2. -i, --interval: Refresh interval in seconds. Required.
  3. -b, --browser: Browser to use, either chrome or firefox. Defaults to chrome.
  4. -n, --max-refreshes: Number of refreshes to perform before stopping. If omitted, the tool runs until manually stopped.

The program can be stopped at any time with Ctrl+C, which closes the browser cleanly.

How It Works

  1. A Selenium controlled browser window is launched.
  2. The specified URL is opened.
  3. The program waits for the specified interval, then calls driver.refresh().
  4. This process repeats until the program is stopped manually or the optional refresh limit is reached.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

A Python tool that automatically refreshes a webpage in the browser at a set interval.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages