
Automation · 2025 · advanced · Built alone
CitaPolicia
A Python browser-automation system created to deal with a difficult real-world problem: monitoring a changing appointment website where static selectors repeatedly break.
Automation that fails into analysis instead of dying on the first renamed class.
Highlights
- Playwright automation with clean architecture
- Deterministic fast path plus AI structure analysis
- Concurrency, logging, and tests for a hostile UI
The story
CitaPolicia came out of a real frustration with appointment systems.
Browser automation often works perfectly — until the website changes.
An earlier script depended heavily on specific page selectors. When the target site changed its structure, those assumptions stopped being reliable.
Instead of simply replacing one set of selectors with another, I redesigned the project around a more maintainable architecture.
The newer implementation separates browser control, strategies, actions, AI analysis, models, logging and configuration.
The main deterministic automation path remains fast and predictable, while a background AI worker can analyze page structure and provide fallback suggestions when ordinary selectors fail.
The goal was not to replace deterministic automation with AI; it was to combine both approaches so each could cover the other's weaknesses.
Main challenge
Building browser automation resilient enough to survive website changes without letting an AI agent unpredictably control the entire flow.
What this demonstrates
Python automation, Playwright, clean architecture, SOLID principles, AI-assisted automation, concurrency, resilience and testing.