- Goal: automate extraction of Philadelphia Council events for 2025 from the official calendar.
- Flow: navigate to phila.legistar.com → click calendar → select 2025 → extract event data (name, date, time).
- Benefits: quickly gather upcoming council events without manual browsing, structured data ready for analysis or notifications. Docs → https://docs.stagehand.dev/v3/first-steps/introduction
- act: perform UI actions from a prompt (click, select, navigate). Docs → https://docs.stagehand.dev/basics/act
- extract: pull structured data from a page using AI and Pydantic schemas. Docs → https://docs.stagehand.dev/basics/extract
- Pydantic schema: type-safe data models that validate extracted content.
- cd council-events
- uv venv && source .venv/bin/activate # On Windows: .venv\Scripts\activate
- pip install stagehand python-dotenv pydantic
- cp .env.example .env # Add your Browserbase API key to .env
- python main.py
- Initializes Stagehand session with Browserbase
- Navigates to Philadelphia Council calendar
- Selects 2025 events from dropdown
- Extracts event names, dates, and times
- Displays structured JSON output with all events
- Provides live session URL for monitoring
- Closes session cleanly
- "ModuleNotFoundError": ensure all dependencies are installed via pip
- Missing credentials: verify .env contains BROWSERBASE_API_KEY
- No events found: check if the website structure has changed or if 2025 calendar is available
- Network issues: ensure internet access and phila.legistar.com is accessible
- Import errors: activate your virtual environment if you created one
• Civic monitoring: Track upcoming council meetings, hearings, and votes for advocacy or journalism. • Event aggregation: Pull council calendars into dashboards, newsletters, or community notification systems. • Research & analysis: Collect historical event data to analyze meeting frequency, topics, or scheduling patterns.
• Multi-year extraction: Loop through multiple years to build historical event database. • Event details: Click into individual events to extract agendas, attendees, and documents. • Notifications: Set up scheduled runs to detect new events and send alerts via email/Slack.
📚 Stagehand Docs: https://docs.stagehand.dev/v3/first-steps/introduction 🎮 Browserbase: https://www.browserbase.com 💡 Try it out: https://www.browserbase.com/playground 🔧 Templates: https://www.browserbase.com/templates 📧 Need help? support@browserbase.com 💬 Discord: http://stagehand.dev/discord