Grab appointment slots the moment they open
Monitor booking pages for cancellations and openings
What you will receive
New appointment slot available
just now
A slot just opened up! Service: Driving test Date: March 15, 2024 Time: 10:30 AM Book now before it's gone →
How it works
- 1Humrun checks the booking page on your schedule
- 2It looks for available appointment slots
- 3When a new slot appears, you get notified immediately
You configure
https://dmv.gov/appointments
The URL of the appointment booking page
.available-slot, .open-time
CSS selector for available time slots
View Python code
import requests
from bs4 import BeautifulSoup
from state import state
import os
BOOKING_URL = os.environ.get("BOOKING_URL")
SLOT_SELECTOR = os.environ.get("SLOT_SELECTOR", ".available, .open, [data-available='true']")
response = requests.get(BOOKING_URL, headers={"User-Agent": "Mozilla/5.0"})
soup = BeautifulSoup(response.text, "html.parser")
slot_elements = soup.select(SLOT_SELECTOR)
current_slots = set(elem.get_text(strip=True) for elem in slot_elements if elem.get_text(strip=True))
previous_slots = set(state.get("slots", []))
state["slots"] = list(current_slots)
new_slots = current_slots - previous_slots
if not previous_slots:
print(f"First run - found {len(current_slots)} available slots")
elif new_slots:
raise Exception(f"New appointment slots available:\n" + "\n".join(f"• {slot}" for slot in new_slots))
else:
print(f"No new slots. {len(current_slots)} currently available.")Humrun remembers previously seen slots to only alert on new openings.
Suggested schedule: Every 15 minutes•Notifications: When an alert is triggered