Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FBRef] ValueError: not enough values to unpack (expected 1, got 0) #665

Open
llowe10 opened this issue Aug 4, 2024 · 3 comments
Open
Labels
FBref Issue or pull request related to the FBref scraper

Comments

@llowe10
Copy link

llowe10 commented Aug 4, 2024

Running into the following error when reading team season stats with latest version of soccerdata package 1.8.1 running on python3.12 in anaconda environment.

ValueError                                Traceback (most recent call last)
Cell In[2], line 1
----> 1 fbref.read_team_season_stats(stat_type="standard")

File ~\anaconda3\envs\python312\Lib\site-packages\soccerdata\fbref.py:319, in FBref.read_team_season_stats(self, stat_type, opponent_stats)
    317 # parse HTML and select table
    318 tree = html.parse(reader)
--> 319 (html_table,) = tree.xpath(
    320     f"//table[@id='stats_teams_{stat_type}' or @id='stats_squads_{stat_type}']"
    321 )
    322 df_table = _parse_table(html_table)
    323 df_table["league"] = lkey

ValueError: not enough values to unpack (expected 1, got 0)
@llowe10 llowe10 closed this as completed Aug 13, 2024
@Klausul
Copy link

Klausul commented Aug 13, 2024

I'm having the same issue, how did you solve it?

@llowe10 llowe10 reopened this Aug 13, 2024
@llowe10
Copy link
Author

llowe10 commented Aug 13, 2024

I'm having the same issue, how did you solve it?

@Klausul - I actually haven't solved it, so I reopened the issue. For some reason I'm running into the issue on one of my devices, but it works fine on my other device.

@probberechts probberechts added the FBref Issue or pull request related to the FBref scraper label Aug 15, 2024
@probberechts
Copy link
Owner

The following works fine for me:

fbref = sd.FBref("ESP-La Liga", "23-24", no_cache=True)
fbref.read_team_season_stats(stat_type="standard")

For which league / season are you experiencing problems?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FBref Issue or pull request related to the FBref scraper
Projects
None yet
Development

No branches or pull requests

3 participants