oseymour / ScraperFC

Python package for scraping soccer data from a variety of sources
GNU General Public License v3.0
222 stars 49 forks source link

Bug Related with the Week when not all game is played #2

Closed hedonistrh closed 2 years ago

hedonistrh commented 2 years ago

Hey, currently I am trying to scrape matches of EPL 2021 with the following code

import ScraperFC as sfc
scraper_understat = sfc.Understat()
matches = scraper_understat.scrape_matches(year=2022, league="EPL")

However, this raise an exception. When I try to debug with the logging of links via source code, I realized that one of the "url" is None. Then I just trace back how we get that data and it is coming from here. Main reason of the exception is Wolves vs City match has not started. (AFAIK, that is postponed because of FA cup game) ⏳

I think that is kind of small issue and can gone when Understat change that page. However, instead of raising an Exception maybe there can be some logging message and process can continue. Just as an idea but not sure that is the best way or not. 🙇

image

oseymour commented 2 years ago

This is a known issue. I was only worried about previous seasons when I wrote the code for this module. I'll put this at the top of the to-do list for when I get some time to work on ScraperFC. Thanks for bringing it up!

hedonistrh commented 2 years ago

Thanks a lot. I'll also try to look that if I have enough time. Thanks for effort. 🙏

oseymour commented 2 years ago

I just pushed a fix for this! Give it a go and let me know if it works for you.

hedonistrh commented 2 years ago

Hey @oseymour, I tried with 1.11.2 and it failed as expected. Then tried with 1.11.5 and now it has no issue at all. Thanks a lot for the quick fix. 🙏