Description
Question:
Sofascore functions are not working anymore. I prepared a book on a specific match around 2 weeks ago, I tried to run it again now but it seems like all the functions are down.
Any confirmation?
Example:
When I run ss.scrape_team_match_stats(id)
I now get an empty dataframe
Empty DataFrame
Columns: []
Index: []
Example 2:
player_stat=ss.scrape_player_match_stats(id)
JSONDecodeError Traceback (most recent call last)
Cell In[6], line 1
----> 1 player_stat=ss.scrape_player_match_stats(id)
2 print(player_stat)
3 #player_stat.to_csv("player_stat.csv")
File ~\AppData\Roaming\Python\Python313\site-packages\ScraperFC\sofascore.py:416, in Sofascore.scrape_player_match_stats(self, match)
404 """ Scrape player stats for a match
405
406 Parameters
(...) 413 : DataFrame
414 """
415 match_id = self._check_and_convert_to_match_id(match)
--> 416 match_dict = self.get_match_dict(match_id) # used to get home and away team names and IDs
417 url = f'{API_PREFIX}/event/{match_id}/lineups'
418 response = botasaurus_get(url)
File ~\AppData\Roaming\Python\Python313\site-packages\ScraperFC\sofascore.py:195, in Sofascore.get_match_dict(self, match)
193 match_id = self._check_and_convert_to_match_id(match)
194 response = botasaurus_get(f'{API_PREFIX}/event/{match_id}')
--> 195 data = response.json()['event']
196 return data
File ~\AppData\Roaming\Python\Python313\site-packages\botasaurus_requests\response.py:183, in Response.json(self, **kwargs)
182 def json(self, **kwargs) -> Union[dict, list]:
--> 183 return loads(self.content, **kwargs)
File c:\Program Files\Python313\Lib\json_init_.py:346, in loads(s, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
341 s = s.decode(detect_encoding(s), 'surrogatepass')
343 if (cls is None and object_hook is None and
344 parse_int is None and parse_float is None and
345 parse_constant is None and object_pairs_hook is None and not kw):
--> 346 return _default_decoder.decode(s)
347 if cls is None:
348 cls = JSONDecoder
File c:\Program Files\Python313\Lib\json\decoder.py:345, in JSONDecoder.decode(self, s, _w)
340 def decode(self, s, _w=WHITESPACE.match):
341 """Return the Python representation of s
(a str
instance
342 containing a JSON document).
343
344 """
--> 345 obj, end = self.raw_decode(s, idx=_w(s, 0).end())
346 end = _w(s, end).end()
347 if end != len(s):
File c:\Program Files\Python313\Lib\json\decoder.py:363, in JSONDecoder.raw_decode(self, s, idx)
361 obj, end = self.scan_once(s, idx)
362 except StopIteration as err:
--> 363 raise JSONDecodeError("Expecting value", s, err.value) from None
364 return obj, end
JSONDecodeError: Expecting value: line 2 column 1 (char 1)