⚠️ Work in Progress: Not Fully Functional Yet!This project is under active development. Player-level stat extraction and merging are not yet complete. CSV automation for all player stats is in progress. Please check back soon for a fully working version!
This project provides a robust, Playwright-based Python scraper for fetching all available betting markets and odds for the 2025 PGA Championship from DraftKings. It is designed for reliability with JavaScript-rendered content, automatic caching, and easy data export.
- Scrapes all main DraftKings betting markets for the PGA Championship (e.g. Tournament Winner, Top Finish, Winner Without, Double Chance, etc).
- Accurately associates player names and odds for each market.
- Automatic caching: Only fetches new data if the last scrape is over 1 minute old, reducing unnecessary site requests.
- Exports data to JSON for easy downstream analysis.
- Python 3.8+
- Playwright (
pip install playwright) - pandas (
pip install pandas)
-
Install dependencies:
pip install playwright pandas playwright install
-
(Optional) If you are running for the first time, Playwright will prompt you to install browser binaries.
Run the scraper from the project directory:
python playwright_fetch_dk.py- If
draftkings_odds_latest.jsonis less than 1 minute old, the script loads cached data. - If not, it scrapes fresh odds from DraftKings, saves them to JSON, and prints a preview.
- JSON file:
draftkings_odds_latest.jsoncontaining a list of player/market/odds records. - Example structure:
[ { "Player": "Scottie Scheffler", "TOURNAMENT WINNER": "+425", "TOP FINISH (INC. TIES)": "+100", ... }, ... ]
- This script is designed for the 2025 PGA Championship but can be adapted for other golf events with minor URL changes.
- For static HTML or other sportsbooks, you may need to implement a different scraping approach.
MIT License