Never let your free PythonAnywhere web app expire again.
Tired of logging in manually every three months just to click one button? This intelligent automation bot handles the heavy lifting for you. It monitors your expiration dates locally and stealthily logs in to extend your app's life right before it goes offline. Set it, forget it, and keep your projects running forever.
This isn't just a "dumb" clicking script. It's smart engineering.
- 🧠 Intelligent Scheduling: It's efficient. It checks a local JSON database first and only launches the browser when absolutely necessary (e.g., less than 7 days remaining).
- 🥷 Stealth Mode Activated: Engineered with specific headers and JavaScript injection to bypass standard bot detection (like 403 Forbidden errors).
- ⚡ Blazing Fast: Turbo-charged performance. It blocks heavy images and uses "eager loading" strategies to click that button in seconds without waiting for the full page to render.
- 🔄 Auto-Healing Database: It doesn't just click; it verifies. After renewal, it scrapes the new future expiry date from the dashboard and updates your local config automatically.
- 📜 Robust Logging: Keeps detailed daily logs for peace of mind and automatically cleans up old history to save space.
Before you begin, ensure you have the following ready:
- 🐍 Python 3.7+ installed.
- 🌐 Google Chrome (latest stable version).
- 📦 pip (Python package manager).
Get up and running in 3 easy steps.
# Clone the project on your device
git clone https://github.com/rabahdj2002/PythonAnywhere-Auto-Refresher.git
# Cd to the working folder
cd pythonanywhere-refresher
# Install required Python packages
pip install selenium webdriver-managerCreate a websites.json file in the root directory.
💡 Pro Tip: Don't know your current expiry date? Just use an old date like
"2000-01-01". The bot will detect it as expired, run the renewal immediately, and fix the date for you!
[
{
"username": "your_pa_username",
"password": "your_pa_password",
"expiry_date": "2000-01-01"
},
{
"username": "second_account_user",
"password": "second_password",
"expiry_date": "2025-12-31"
}
]Create a params.json file to control the bot's behavior.
{
"threshold_days": 7,
"loop_interval_seconds": 86400,
"headless_mode": true
}threshold_days: Renew if the site expires in less than this many days.loop_interval_seconds: How often to check (86400 seconds = 24 hours).headless_mode: Settruefor invisible background running, orfalseto watch the browser work.
Fire up the script and let it do its magic.
python smart_renewer.pyThe script will enter a continuous loop, checking your local database daily and only launching Chrome when action is required.
Built with ❤️ and Python.