[GH-ISSUE #709] Fotmob new UCL format scrapping issue #152

Closed
opened 2026-03-02 15:56:13 +03:00 by kerem · 1 comment
Owner

Originally created by @mhassan2048 on GitHub (Sep 17, 2024).
Original GitHub issue: https://github.com/probberechts/soccerdata/issues/709

Describe the bug
Fotmob is being scrapped, possibly due to the UCL format change. Works fine for earlier seasons.

Affected scrapers
This affects the following scrapers:

  • FotMob

Code example
A minimal code example that fails. Use no_cache=True to make sure an invalid cached file does not cause the bug and make sure you have the latest version of soccerdata installed.

import soccerdata as sd
fotmob = sd.FotMob(leagues='EUR-Champions League', seasons='2024/2025')
print(fotmob.__doc__)
schedule = fotmob.read_schedule()
schedule.head()

Error message

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[16], line 1
----> 1 schedule = fotmob.read_schedule()
      2 schedule.head()

File /Volumes/Hannibal/AC_new/anaconda3/lib/python3.11/site-packages/soccerdata/fotmob.py:293, in FotMob.read_schedule(self, force_cache)
    289     all_schedules.append(df)
    291 # Construct the output dataframe
    292 df = (
--> 293     pd.concat(all_schedules)
    294     .rename(
    295         columns={
    296             "roundName": "round",
    297             "round": "week",
    298             "home.name": "home_team",
    299             "away.name": "away_team",
    300             "status.reason.short": "status",
    301             "pageUrl": "url",
    302             "id": "game_id",
    303         }
    304     )
    305     .replace(
    306         {
    307             "home_team": TEAMNAME_REPLACEMENTS,
    308             "away_team": TEAMNAME_REPLACEMENTS,
    309         }
    310     )
    311     .assign(date=lambda x: pd.to_datetime(x["status.utcTime"], format="mixed"))
    312 )
    313 df["game"] = df.apply(make_game_id, axis=1)
    314 df["url"] = "https://fotmob.com/" + df["url"]

File /Volumes/Hannibal/AC_new/anaconda3/lib/python3.11/site-packages/pandas/core/reshape/concat.py:382, in concat(objs, axis, join, ignore_index, keys, levels, names, verify_integrity, sort, copy)
    379 elif copy and using_copy_on_write():
    380     copy = False
--> 382 op = _Concatenator(
    383     objs,
    384     axis=axis,
    385     ignore_index=ignore_index,
    386     join=join,
    387     keys=keys,
    388     levels=levels,
    389     names=names,
    390     verify_integrity=verify_integrity,
    391     copy=copy,
    392     sort=sort,
    393 )
    395 return op.get_result()

File /Volumes/Hannibal/AC_new/anaconda3/lib/python3.11/site-packages/pandas/core/reshape/concat.py:445, in _Concatenator.__init__(self, objs, axis, join, keys, levels, names, ignore_index, verify_integrity, copy, sort)
    442 self.verify_integrity = verify_integrity
    443 self.copy = copy
--> 445 objs, keys = self._clean_keys_and_objs(objs, keys)
    447 # figure out what our result ndim is going to be
    448 ndims = self._get_ndims(objs)

File /Volumes/Hannibal/AC_new/anaconda3/lib/python3.11/site-packages/pandas/core/reshape/concat.py:507, in _Concatenator._clean_keys_and_objs(self, objs, keys)
    504     objs_list = list(objs)
    506 if len(objs_list) == 0:
--> 507     raise ValueError("No objects to concatenate")
    509 if keys is None:
    510     objs_list = list(com.not_none(*objs_list))

ValueError: No objects to concatenate

Contributor Action Plan

  • I’m unsure how to fix this, but I'm willing to work on it with guidance.
  • I’m not able to fix this issue.
Originally created by @mhassan2048 on GitHub (Sep 17, 2024). Original GitHub issue: https://github.com/probberechts/soccerdata/issues/709 **Describe the bug** Fotmob is being scrapped, possibly due to the UCL format change. Works fine for earlier seasons. **Affected scrapers** This affects the following scrapers: - [ ] FotMob **Code example** A minimal code example that fails. Use `no_cache=True` to make sure an invalid cached file does not cause the bug and make sure you have the latest version of soccerdata installed. ```python import soccerdata as sd fotmob = sd.FotMob(leagues='EUR-Champions League', seasons='2024/2025') print(fotmob.__doc__) schedule = fotmob.read_schedule() schedule.head() ``` **Error message** ``` --------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In[16], line 1 ----> 1 schedule = fotmob.read_schedule() 2 schedule.head() File /Volumes/Hannibal/AC_new/anaconda3/lib/python3.11/site-packages/soccerdata/fotmob.py:293, in FotMob.read_schedule(self, force_cache) 289 all_schedules.append(df) 291 # Construct the output dataframe 292 df = ( --> 293 pd.concat(all_schedules) 294 .rename( 295 columns={ 296 "roundName": "round", 297 "round": "week", 298 "home.name": "home_team", 299 "away.name": "away_team", 300 "status.reason.short": "status", 301 "pageUrl": "url", 302 "id": "game_id", 303 } 304 ) 305 .replace( 306 { 307 "home_team": TEAMNAME_REPLACEMENTS, 308 "away_team": TEAMNAME_REPLACEMENTS, 309 } 310 ) 311 .assign(date=lambda x: pd.to_datetime(x["status.utcTime"], format="mixed")) 312 ) 313 df["game"] = df.apply(make_game_id, axis=1) 314 df["url"] = "https://fotmob.com/" + df["url"] File /Volumes/Hannibal/AC_new/anaconda3/lib/python3.11/site-packages/pandas/core/reshape/concat.py:382, in concat(objs, axis, join, ignore_index, keys, levels, names, verify_integrity, sort, copy) 379 elif copy and using_copy_on_write(): 380 copy = False --> 382 op = _Concatenator( 383 objs, 384 axis=axis, 385 ignore_index=ignore_index, 386 join=join, 387 keys=keys, 388 levels=levels, 389 names=names, 390 verify_integrity=verify_integrity, 391 copy=copy, 392 sort=sort, 393 ) 395 return op.get_result() File /Volumes/Hannibal/AC_new/anaconda3/lib/python3.11/site-packages/pandas/core/reshape/concat.py:445, in _Concatenator.__init__(self, objs, axis, join, keys, levels, names, ignore_index, verify_integrity, copy, sort) 442 self.verify_integrity = verify_integrity 443 self.copy = copy --> 445 objs, keys = self._clean_keys_and_objs(objs, keys) 447 # figure out what our result ndim is going to be 448 ndims = self._get_ndims(objs) File /Volumes/Hannibal/AC_new/anaconda3/lib/python3.11/site-packages/pandas/core/reshape/concat.py:507, in _Concatenator._clean_keys_and_objs(self, objs, keys) 504 objs_list = list(objs) 506 if len(objs_list) == 0: --> 507 raise ValueError("No objects to concatenate") 509 if keys is None: 510 objs_list = list(com.not_none(*objs_list)) ValueError: No objects to concatenate ``` **Contributor Action Plan** - [ ] I’m unsure how to fix this, but I'm willing to work on it with guidance. - [ ] I’m not able to fix this issue.
kerem 2026-03-02 15:56:13 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@mhassan2048 commented on GitHub (Sep 18, 2024):

The issue was related to clearing the fotmob cache

<!-- gh-comment-id:2359026833 --> @mhassan2048 commented on GitHub (Sep 18, 2024): The issue was related to clearing the fotmob cache
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#152
No description provided.