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.
- Configurable refresh interval, specified in seconds
- Compatible with both Chrome and Firefox
- Optional limit on the number of refreshes, or continuous operation until manually stopped
- Automatic download of the correct browser driver through webdriver manager, requiring no manual driver setup
git clone https://github.com/DevAshish9090/webpage-auto-refresher.git
cd webpage-auto-refresher
pip install -r requirements.txtChrome or Firefox must be installed on the machine running the script. The matching driver is downloaded automatically on first run.
python auto_refresher.py --url <URL> --interval <SECONDS>Refresh a page every 30 seconds.
python auto_refresher.py -u https://example.com -i 30Refresh every 10 seconds using Firefox.
python auto_refresher.py -u example.com -i 10 -b firefoxRefresh every 5 seconds and stop automatically after 20 refreshes.
python auto_refresher.py -u https://example.com -i 5 -n 20-u,--url: URL of the page to refresh. Required.-i,--interval: Refresh interval in seconds. Required.-b,--browser: Browser to use, eitherchromeorfirefox. Defaults tochrome.-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.
- A Selenium controlled browser window is launched.
- The specified URL is opened.
- The program waits for the specified interval, then calls
driver.refresh(). - This process repeats until the program is stopped manually or the optional refresh limit is reached.
This project is licensed under the MIT License. See the LICENSE file for details.