Inspired by the transfermarkt player comparison feature. Data scraping exercise. Inspired by the player comparison feature on transfermarkt, the goal was to compare retired players, eg Robben, Iniesta, Maradona, etc. Built as a data scraping exercise on a PC without access to VS studio or an alternative code editor :(.
The Futbin Player Data Scraper is a Python script designed to extract player data from the Futbin website. It focuses on player details, including name, club, nation, league, rating, version, and attribute details.
-
Data Extraction: Extracts player information from multiple pages on the Futbin website.
-
Pagination Handling: Dynamically identifies and navigates through multiple pages to ensure all player data is captured.
-
CSV Export: Outputs the collected player data to a CSV file (
player_data.csv
) for easy integration with data analysis tools.
-
Installation:
- Clone the repository to your local machine.
- Install the required Python packages using
pip install -r requirements.txt
.
-
Run the Script:
- Open a terminal in the project directory.
- Run the script using
python filename.py
(replacefilename.py
with the actual filename of your Python script).
-
CSV Output:
- The script will generate a CSV file named
player_data.csv
in the same directory.
- The script will generate a CSV file named
The following is an example of the data that will be saved to the CSV file:
Pelé,Paris Saint-Germain,Brazil,Ligue 1,96,Winter Wildcard,94,95,90,95,59,80
Cristiano Ronaldo,Manchester United,Portugal,Premier League,94,Base,93,94,79,94,43,75
Lionel Messi,FC Barcelona,Argentina,La Liga,93,Base,92,91,86,92,54,82
Neymar Jr.,Paris Saint-Germain,Brazil,Ligue1,93,Versus Ice,91,87,90,97,41,66
Kylian Mbappé,Paris Saint-Germain,France,Ligue1,93,UCL TOTGS,98,92,84,94,40,81
- If you are having problems running the script, make sure that you have installed the required Python libraries.
- If you are getting an error message saying "ModuleNotFoundError: No module named 'bs4'", make sure that you have installed the beautifulsoup4 library.
- If you are getting an error message saying "ModuleNotFoundError: No module named 'requests'", make sure that you have installed the requests library.
- If you are getting an error message saying "ModuleNotFoundError: No module named 'csv'", make sure that you have installed the csv library.
The Football Player Comparison App allows users to compare retired football players who are no longer playing.
-
Player Comparison: View two players side by side and vote for the preferred player.
-
Elo Rating System: Utilizes an Elo rating system to dynamically adjust player ratings based on user votes.
-
Image Resizing: Automatically resizes player images for a consistent and appealing user interface.
-
Installation:
- Clone the repository to your local machine.
- Ensure you have Python and the required dependencies (Tkinter, Pillow) installed.
-
Run the App:
- Open a terminal in the project directory.
- Run the app using
program.py
-
Player Data Storage:
- Player data, including Elo ratings, is saved locally in a file named
players_data.pkl
.
- Player data, including Elo ratings, is saved locally in a file named
-
Player Images:
- Add or replace player images in the designated folder (
E:\Sept 2022 Lenovo\Football
in the provided script).
- Add or replace player images in the designated folder (
-
Elo Starting Value:
- Adjust the
STARTING_ELO
constant in the script to change the initial Elo rating.
- Adjust the
- Python 3.x
- BeautifulSoup (installed via
pip install beautifulsoup4
) - Requests (installed via
pip install requests
)
- These projects are developed for research and analysis purposes, providing tools for comparing retired football players.
- Inspired by the transfermarkt player comparison feature.
This project is licensed under the MIT License.