mirror of
https://github.com/probberechts/soccerdata.git
synced 2026-04-26 02:25:51 +03:00
[GH-ISSUE #78] [FBref] Team against stats #15
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#15
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 @RobiFera on GitHub (Aug 26, 2022).
Original GitHub issue: https://github.com/probberechts/soccerdata/issues/78
Hi! First of all, thank you for the code!
I'd like to ask if it would be possible to also get stats from the "Opponent Stats" table,
Thanks!
@probberechts commented on GitHub (Aug 26, 2022):
I am not sure to which table you are referring. Can you provide a link?
@RobiFera commented on GitHub (Aug 26, 2022):
yep, so for example when viewing the league stats and scrolling down to the various team stats tables, there is an option to switch to an "Opponent Stats" table.
https://fbref.com/en/comps/11/Serie-A-Stats
@probberechts commented on GitHub (Aug 26, 2022):
No, that is currently not implemented. It is a good suggestion, though! I will probably add it at some point, but it might take a while until I find the time time to do so. Feel free to implement it yourself and create a PR.
@RobiFera commented on GitHub (Aug 26, 2022):
It seems that, in fbref.py on read_team_season_stats(), just need to replace "_for" at the end of the table url with "_against".
I personally don't want to create a PR yet because I'd like to test it more, and I haven't worked with it yet :D but this solution seems simple enough and works at first glance.
@RobiFera commented on GitHub (Aug 26, 2022):
Those are the lines where I changed "_for" to "_against"
github.com/probberechts/soccerdata@50f6fef099/soccerdata/fbref.py (L193)github.com/probberechts/soccerdata@50f6fef099/soccerdata/fbref.py (L196)Note that, from what I've seen, only teams have that "Opponent Stats" table