mirror of
https://github.com/probberechts/soccerdata.git
synced 2026-04-25 18:15:58 +03:00
[GH-ISSUE #370] [FBref] match-level opponent data not available for read_team_match_stats #70
Labels
No labels
ESPN
FBref
FotMob
MatchHistory
SoFIFA
Sofascore
WhoScored
WhoScored
bug
build
common
dependencies
discussion
documentation
duplicate
enhancement
good first issue
invalid
performance
pull-request
question
question
removal
understat
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/soccerdata#70
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mhd0528 on GitHub (Sep 15, 2023).
Original GitHub issue: https://github.com/probberechts/soccerdata/issues/370
Hi, is getting opponent team info from
read_team_match_statsstill supported? I got the following error. Any suggestions how to fix this? Thanks in advance!@probberechts commented on GitHub (Sep 24, 2023):
They are simply not available for the "schedule" stat type
@mhd0528 commented on GitHub (Sep 25, 2023):
Ok thanks! I'll look into other types of stats first then.
@mhd0528 commented on GitHub (Sep 25, 2023):
Okay so I tried to disable the local cache and with other stat types other than schedule, but it still gives me a scraping error like below:
And I checked this url, it is not valid in FBref. The closest valid link I can find is: https://fbref.com/en/squads/18bb7c10/2023-2024/matchlogs/all_comps/shooting/Arsenal-Match-Logs-All-Competitions. Is it possible that there is some error in the url generation? Sorry for bothering you recently, I'm trying to figure out what's the error on my end, but can't solve it...
@mhd0528 commented on GitHub (Sep 25, 2023):
I think I might find out what's the problem.
When I scrape data before the current season, e.g.
fbref = sd.FBref(leagues='ENG-Premier League', seasons='2022-23'), I'm able to get team_match data with those stat_types.But if I use
fbref = sd.FBref(leagues='ENG-Premier League', seasons='2023-24'), it will give me the error above.---update---
I checked the team URLs of the current season and previous seasons. The URL for the current season doesn't have
seasonin it. See the example below:2022-23:
Arsenal /en/squads/18bb7c10/2022-2023/Arsenal-Stats2023-24:
Arsenal /en/squads/18bb7c10/Arsenal-StatsThis will lead to an invalid URL for the team match log. I'll try to add a condition to deal with it.
---update---
I have updated the code in my fork and I'm testing it with more history seasons + leagues. I'll pull a merge request once it's verified.
---update---
I have tested the code and it should be good now. Create a PR for it. Hope it help.
https://github.com/probberechts/soccerdata/pull/384