mirror of
https://github.com/probberechts/soccerdata.git
synced 2026-04-26 02:25:51 +03:00
[GH-ISSUE #796] Player ratings wrong scraped in SoFIFA #171
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#171
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 @miguelperosanz on GitHub (Jan 23, 2025).
Original GitHub issue: https://github.com/probberechts/soccerdata/issues/796
Describe the bug
Player ratings wrong in SoFIFA. Only "overallrating", "potential" and "crossing" are correct. It repeats the "crossing" rating for the rest of the variables.
Affected scrapers
This affects the following scrapers:
Code example
Error message
Additional context
Webscraped data incorrect. The code example corresponds to Erling Haaland and it returns the following results:
This pattern of repeating the "Crossing" rating is happening for every player.
Contributor Action Plan
@probberechts commented on GitHub (Jan 23, 2025):
Ah, seems I was too quick...
The issue is the "//" before "em" in this xpath selector:
github.com/probberechts/soccerdata@d31c9a2f75/soccerdata/sofifa.py (L479-L481)Based on some quick tests it has to be a combination of:
f"//p[.//text()[contains(.,'{s}')]]/span/em"f"//div[contains(.,'{s}')]]/em"f"//li[not(self::script)][.//text()[contains(.,'{s}')]]/em"(not sure if the li tag is still used somewhere)where
sis the name of the statistic.If someone has time to debug this properly, please create a PR.
@miguelperosanz commented on GitHub (Feb 8, 2025):
Hi the bug is still there and I am not able to fix it, any ideas?
@probberechts commented on GitHub (Feb 9, 2025):
Should be fixed in v1.8.7, thanks to @franciscofguerreiro 🎉
@miguelperosanz commented on GitHub (Feb 9, 2025):
It works! Thanks a lot!