import requests
import json
# Get the scorecard for a match
match_id = '12345' # Replace with actual match ID
url = f'https://www.cricbuzz.com/match-api/{match_id}/commentary.json'
response = requests.get(url)
if response.status_code == 200:
data = json.loads(response.text)
# Extract relevant information from the JSON response
innings = data['comm_lines'][0]['score']['batting']['scorecard']
overs = data['comm_lines'][0]['score']['overs']
recent_events = data['comm_lines'][0]['evt_txt']
# Print the information
print(f"Innings: {innings}")
print(f"Overs: {overs}")
print(f"Recent events: {recent_events}")
else:
print("Error getting scorecard")
Business Tool Business Tool Revenue: Cost of Goods Sold: Expenses: Calculate Profit: Profit Margin:
Comments
Post a Comment