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

Open
opened 2026-03-02 15:56:04 +03:00 by kerem · 3 comments
Owner

Originally created by @llowe10 on GitHub (Aug 4, 2024).
Original GitHub issue: https://github.com/probberechts/soccerdata/issues/665

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)
Originally created by @llowe10 on GitHub (Aug 4, 2024). Original GitHub issue: https://github.com/probberechts/soccerdata/issues/665 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. ```ini 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) ```
Author
Owner

@Klausul commented on GitHub (Aug 13, 2024):

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

<!-- gh-comment-id:2285752866 --> @Klausul commented on GitHub (Aug 13, 2024): I'm having the same issue, how did you solve it?
Author
Owner

@llowe10 commented on GitHub (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.

<!-- gh-comment-id:2286124543 --> @llowe10 commented on GitHub (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.
Author
Owner

@probberechts commented on GitHub (Aug 15, 2024):

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?

<!-- gh-comment-id:2290848505 --> @probberechts commented on GitHub (Aug 15, 2024): The following works fine for me: ```python 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 in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/soccerdata#135
No description provided.