How deanpatel2/webscraper-premdata works
1. Repository shape
- This is a very small, single-purpose scraping project.
- The entire implementation appears to live in one Python script, FotMob_PremScraper.py, with one sample output file, PL_matchweek_1.csv, plus the README.
2. Primary purpose
- The script extracts Premier League match statistics from FotMob’s “by round” match list.
- It is a data acquisition pipeline, not a full application: input is a FotMob webpage, output is a CSV of match/team statistics.
3. Core runtime
- The scraper is driven by Selenium, so the browser is part of the architecture.
- A local ChromeDriver executable is required, and the script depends on a matching Chrome browser setup on the machine running it.
4. Main data flow
- The script starts at FotMob’s Premier League rounds page.
- It navigates matchweek by matchweek, opens each match, collects statistics from the match pages, and aggregates them into tabular records.
- Those records are then written out to a CSV file.
5. Input boundary
- The external dependency boundary is FotMob’s public web UI and its page structure.
- The scraper depends on the current layout/HTML behavior of FotMob pages, so the architecture is tightly coupled to that external site.
6. Output boundary
- The only persisted artifact described is a CSV file.
- The example CSV suggests a row-per-team or row-per-match-statistics representation containing metrics like xG, xGOT, possession, interceptions, duels, and opposition-half passes.
7. Configuration model
- The script is configured through global variables, specifically DRIVER_PATH and MATCHWEEK.
- That means the operational parameters are embedded in the script rather than managed through a config file, CLI, or environment-based settings.
8. Processing style
- This is a sequential scraper: discover matchweek matches, visit each match, extract stats, append results.
- There is no sign of distributed processing, queueing, database storage, or asynchronous pipeline stages.
9. Technology boundaries
- Python is the implementation language.
- Selenium handles browser automation and page interaction.
- pandas is used for tabular assembly and CSV generation.
10. What is not present
- There are no visible service layers, APIs, web servers, or UI components.
- There is also no evidence of modular packaging, tests, CI/CD, or a database-backed architecture.
11. Domain scope
- The current scope is limited to Premier League matchweek stats.
- The README notes future expansion toward shot maps and additional leagues, but those are not yet part of the implemented architecture.
12. How to diagram it
- The clean architecture view is: user runs script → Selenium-controlled Chrome navigates FotMob → scraper extracts match stats → pandas structures data → CSV file saved locally.
- The two important external boundaries are FotMob on one side and the local ChromeDriver/Chrome environment on the other.
Main entry points: FotMob_PremScraper.py Scraper · PL_matchweek_1.csv CSV export · README.md README
Components 11
Local runtime
Python script and browser automation environment
- Scraper · Single-script Premier League matchweek scraper
FotMob_PremScraper.py - Globals · Embedded settings such as DRIVER_PATH and MATCHWEEK
FotMob_PremScraper.py - ChromeDriver · Local executable required by Selenium
- Chrome · Selenium-controlled browser session
- Discover matches · Step through matchweeks and collect match links
- Extract stats · Read xG, possession, duels, passes and other match metrics
- Tabular data · Build rows for match/team statistics
External site
FotMob web UI and page structure
- Rounds page · Premier League by-round match listing
- Match pages · Per-match pages exposing statistics
Output
Persisted CSV artifact
- CSV export · Write the final dataset to a local CSV file
PL_matchweek_1.csv
Connections 11
- README → Scraper: describes · Documentation points to the single implementation script
- Globals → Scraper: configures · Global variables control driver path and matchweek
- Scraper → ChromeDriver: uses · Script launches Selenium through the local driver
- ChromeDriver → Chrome: starts · Driver controls a Chrome browser session
- Chrome → Rounds page: opens · Browser begins at FotMob's Premier League rounds page
- Scraper → Discover matches: runs · Sequentially discovers matchweeks and match links
- Discover matches → Match pages: visits · Each discovered match is opened in FotMob
- Match pages → Extract stats: exposes · Match pages provide the statistics used by the scraper
- Extract stats → Tabular data: loads · Scraped values are organized into rows and columns
- Tabular data → CSV export: writes · Pandas material is saved as a CSV artifact
- Scraper → CSV export: produces · End result of the pipeline is a local CSV file