Created a web scraper to collect data from the 2024 Puerto Rico General Elections held on November 5, 2024. The data was sourced from the official website of the Puerto Rico State Elections Commission (CEE) and contains all the offices and special election at the island, district, and municipal levels. These are:
The scraper uses Selenium to scrape the website and Pandas to format the data. The data is then saved in CSV format for further analysis. Additionally, the data is visualized using Matplotlib and Geopandas to create the map and PIL to make the GIFs
The colors in the map represent the political party of the winning candidate at the moment the data was collected. The parties are:
The following GIFs were made with the data scraped every five minutes the night of the election. With this data, we can see how different municipalities changed winners as the night progressed. Interesting to note that some municipalities changed winners multiple times during the night.
The source code for this project is not available.