Web Monitor · Python software
Know when a
webpage changes.
Check selected webpage content, detect changes, and receive notifications. Run Web Monitor on your computer or infrastructure you control.
Explore optional browser demosA focused path from page to signal.
Choose the content you care about. Keep control of the check, the destination, and the stored state.
- FetchHTTP request with timeouts, response limits and retry/backoff.
- SelectCSS selectors isolate the relevant elements.
- Normalize & hashExtract text or serialized HTML; calculate its SHA-256 digest.
- CompareCompare with the last committed digest for this target.
- NotifySend the configured alert before committing a changed digest.
The first successful check establishes a quiet baseline. State stores digests and an identifier for the target definition, not scraped content. A changed target definition establishes a new baseline.
Watch the part
that matters.
Useful for authorized public announcements, job posting pages, registration information, product details, documentation, and release or status pages.
A changed digest means selected content changed. It does not interpret a price drop, a new vacancy, or an available seat for you.
- Independent targets
- Monitor one page or up to 64 targets in a process. Each keeps its own state; one failure does not block the others.
- Text or HTML
- Use a CSS selector to focus extraction. Text comparison can ignore markup changes; HTML comparison can detect attribute changes.
- Controlled operation
- Configure polling intervals, timeouts, response limits and retries. Redirects are not followed; transient failures use exponential backoff.
- Inspectable local output
- Digest-only state and privacy-safe health JSON. Run from a terminal, Docker, or a hardened systemd service.
Get started with the real software
Your first check, on your machine.
Python 3.10–3.14 verified in CI. Start with the loopback example: no external target or notification credentials needed.
1. Install & create configuration
Use a fresh checkout and a private working directory. Choose the commands for your shell.
Windows PowerShell
git clone https://github.com/AlirezaBelal/web-monitor.git
cd web-monitor
python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -r requirements.txt
python -c "import shutil; shutil.copyfile('config.example.json', 'config.json')"
macOS & Linux
git clone https://github.com/AlirezaBelal/web-monitor.git
cd web-monitor
python -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txt
python -c "import shutil; shutil.copyfile('config.example.json', 'config.json')"
If PowerShell blocks activation, use
.\.venv\Scripts\python.exe in place of
python for the commands below; activation is
optional.
2. Serve a local page
Create a small HTML fixture:
python -c "from pathlib import Path; Path('demo').mkdir(exist_ok=True); Path('demo/index.html').write_text('<main>Initial value</main>', encoding='utf-8')"
In a second terminal, from the repository directory, keep this server running:
python -m http.server 8000 --bind 127.0.0.1 --directory demo
The example configuration already watches
http://127.0.0.1:8000/ with the selector
main and console notifications.
3. Run the local walkthrough
Back in the first terminal, validate and run two checks:
python main.py --config config.json --validate-config
python main.py --config config.json --once
python main.py --config config.json --once
The first successful check reports baseline; the second reports unchanged. Update the local page and check again:
python -c "from pathlib import Path; Path('demo/index.html').write_text('<main>Updated value</main>', encoding='utf-8')"
python main.py --config config.json --once
You should see changed and a console alert. Now
edit your local config.json with an authorized target,
CSS selector, comparison mode and reasonable interval. Validate
again, then keep Python running for continuous checks:
python main.py --config config.json
Stop with Ctrl+C. No checks run after the process stops. Rerunning the tutorial with existing state may report a change or unchanged instead of a first baseline.
Configuration referenceFull installation guideSecurity guidance
Route the alert.
Keep the credentials private.
Console output works by default. Optional desktop alerts need
requirements-desktop.txt. Webhook and Telegram delivery
run from your Python environment, never from this site.
For continuous monitoring, keep your computer or private server available and the process running.
Notification setup & delivery semanticsConfigure Webhook or Telegram
Use notification.backend set to
webhook or telegram. Configuration
stores variable names, while protected runtime environment
variables hold the actual values.
WEBMONITOR_WEBHOOK_URL
WEBMONITOR_TELEGRAM_BOT_TOKEN
WEBMONITOR_TELEGRAM_CHAT_ID
Never commit credentials or secret-bearing destinations. Failed delivery retains the old digest and retries on the next check; rare duplicates are possible.
Deploy with Docker
The documented image runs as a non-root user. Build it locally:
docker build -t webmonitor .
Use the tracked container configuration, a read-only configuration
mount, protected runtime secrets and a persistent
/data volume. Container loopback is separate from
your host’s loopback.
Run as a systemd service
The tracked unit uses a dedicated account, restrictive umask and
sandboxing. Keep configuration in /etc/webmonitor,
secrets in a protected environment file and state in
/var/lib/webmonitor.
Optional educational experiences
Explore the concepts.
These browser tools help explain comparison and failure behavior. They do not replace installing and running the Python monitor.
Real local computation
Compare two snapshots
Edit the fictional sample or paste authorized plain text. Compare what changed after whitespace normalization. Do not paste credentials or private data on a shared device.
20,000 characters per input · text only
Fictional sample loaded · ready to compare.
Removed span
Added span
How comparison works & where the boundary is
This tool collapses every JavaScript whitespace run to one space and trims both ends, then compares the resulting strings exactly. Case and punctuation count. A linear common-prefix/suffix calculation shows one changed span, grouping separate edits when necessary; previews stop at 500 characters. It does not parse HTML or apply CSS selectors.
The Python monitor selects HTML with Beautiful Soup, extracts text or serialized HTML, and compares SHA-256 digests. This plain-text workbench demonstrates the concept; it does not claim identical normalization. No requests, uploads, analytics, third-party processing, or persistent input storage. Clear inputs to discard this workspace; original sources, browser extensions, and device memory are outside this tool’s control.
Guided synthetic scenarios
Follow the monitoring cycle
Simulation — no external requests, persistent scheduling, or delivered notifications.
01 · Establish baselines and exhaust a request retry budget.
Ready · no checks have runObservation ledger
Newest first · last 60 synthetic events
No events in this view. Run a cycle or choose All events.
Operational truth
A change is more than a green light.
- Baseline ≠ alert
- The first successful observation records a digest. Unchanged content stays quiet. A recovered request can be unchanged or establish its first baseline.
- Notify → commit
- Python sends the configured alert before saving a changed digest. Failed delivery keeps the old digest for the next check. A failure after remote delivery can cause a duplicate: at-least-once semantics.
- Bounded, static HTTP
- Python uses requests and Beautiful Soup, with timeouts, response limits, and controlled backoff. It does not follow redirects, render JavaScript, sign into accounts, or run a distributed scheduler.
Clear boundaries. Responsible checks.
- Real monitoring requires a running Python process. This static website has no hosted backend, URL-fetching service, scheduler, or multi-user dashboard.
- No JavaScript webpage rendering, automatic login/session workflows, or historical scraped-content archive. Only selected server-returned content is compared; visible browser changes may be missed.
- Monitor only authorized pages. Respect site terms, privacy and reasonable polling rates. HTTP 429 uses configured backoff; Retry-After is not automatically honored.
- Protect local configuration, notification destinations, state directories and environment secrets. Health output excludes URLs and scraped content.
Make the next check deliberate.
Start locally. Choose your target. Keep the process under your control.