This provides similar data to the previous endpoint, however there are some differences. For this reason I have only modified the major_teams function with this in order to get it functional (with which the rest are).
def _major_teams(self):
return [x['team']['longName'] for x in self.new_json['content']['teams']]
Eventually it would most likely be wise to update the rest of the functions to the latest 'endpoint' but for now this fixes previous problems.
Player Object Update - Major Teams (_major_teams)
This attempts to fix issue [BUG] Player class is not working with Python 3.11.0 #59
The ESPN Cricinfo html page has been updated with class and syntax changes which mean the previous _major_teams function did not work:
There is a new endpoint which the ESPN Cricinfo page appears to utilise for player data (or in conjunction with the previous). Example: (https://hs-consumer-api.espncricinfo.com/v1/pages/player/home?playerId=7069)
This provides similar data to the previous endpoint, however there are some differences. For this reason I have only modified the major_teams function with this in order to get it functional (with which the rest are).
Eventually it would most likely be wise to update the rest of the functions to the latest 'endpoint' but for now this fixes previous problems.