This repository contains a Python script designed to scrape football data from FBRef using BeautifulSoup and Pandas. The scraped data is intended to be used for predicting English Premier League (EPL) matches. Please note that accessing websites programmatically, especially ones with protective measures like anti-bot mechanisms, may violate their terms of service. Ensure compliance with FBRef's policies before using this code.
To run the code, make sure you have the following dependencies installed:
Python (version 3.6 or higher) BeautifulSoup4 Pandas
You can install these packages using the following command: pip install beautifulsoup4 pandas
Usage
prem_scraping.py This script is designed to scrape FBRef football data. However, be cautious about the legality of web scraping and ensure that you comply with FBRef's terms of service.
The scraped data will be stored in a CSV file named prem_matches.csv. This file will contain various football statistics that can be used for EPL match predictions.
The predict_matches.py script utilizes the scraped data to predict English Premier League matches. Before running this script, ensure that you have the required libraries installed: pip install scikit-learn
python predict_prem_winners.py
This script uses a machine learning model to predict match outcomes based on the scraped FBRef data. Adjust the model and parameters as needed for your specific requirements.
Important: Web scraping may violate the terms of service of the website being scraped. Use this code responsibly and ensure compliance with FBRef's policies. The author of this code is not responsible for any misuse or violation of terms of service.
Feel free to contribute by forking the repository and submitting a pull request. Bug reports, feature requests, and suggestions are also welcome in the "Issues" section.