You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently we get matches from the entire week. I would like to get them by days too. I wrote a script for that which I am using currently I will share it here.
Also summary.py has some problem when trying to create a Summary object.
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "C:\Users\ehsan\AppData\Local\Programs\Python\Python36\lib\site-packages\espncricinfo\summary.py", line 7, in __init__
self.json = self.get_json()
File "C:\Users\ehsan\AppData\Local\Programs\Python\Python36\lib\site-packages\espncricinfo\summary.py", line 13, in get_json
return r.json()
File "C:\Users\ehsan\AppData\Local\Programs\Python\Python36\lib\site-packages\requests\models.py", line 896, in json
return complexjson.loads(self.text, **kwargs)
File "C:\Users\ehsan\AppData\Local\Programs\Python\Python36\lib\json\__init__.py", line 354, in loads
return _default_decoder.decode(s)
File "C:\Users\ehsan\AppData\Local\Programs\Python\Python36\lib\json\decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users\ehsan\AppData\Local\Programs\Python\Python36\lib\json\decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 2 (char 1)
Code for getting matches by the day.
def get_recent_matches_day(date=None):
if date:
#date format should be YYYYmmdd e.g. 20180814
url = "http://www.espncricinfo.com/scores/?date=date"
else:
url = "http://www.espncricinfo.com/scores/"
r = requests.get(url)
soup = BeautifulSoup(r.text, 'html.parser')
return [x['href'].split('/', 4)[4].split('.')[0] for x in soup.findAll('a', href=True, text='SCORECARD')]
The text was updated successfully, but these errors were encountered:
Yeah, I get a 404 for the summary.json url. There is an RSS feed of current matches (http://static.cricinfo.com/rss/livescores.xml) that could be used to get current matches. I might try to knock something together to parse this if anyone's interested.
Currently we get matches from the entire week. I would like to get them by days too. I wrote a script for that which I am using currently I will share it here.
Also summary.py has some problem when trying to create a Summary object.
Code for getting matches by the day.
The text was updated successfully, but these errors were encountered: