Да можно прямо в коде!
import requests
import json
from pprint import pprint
def getMatches():
url = 'https://ls.sportradar.com/ls/feeds/?/itf/en/Europe:Berlin/gismo/event_getitf'
response = requests.get(url)
response.encoding = 'utf-8'
parsed_string = response.json()
k = parsed_string["doc"][0]["data"]
for i in k:
l = (i["matchid"])
m = str(l)
link = 'https://ls.sportradar.com/ls/feeds/?/itf/en/Europe:Berlin/gismo/match_detailsextended/' + m
yield link
def printMatch(match):
pprint(match["data"]["teams"], indent=2)
for url in getMatches():
response = requests.get(url)
response.encoding = 'utf-8'
match = response.json()
for doc in match["doc"]:
printMatch(doc)
Вывод:
{'away': 'Ianchuk, Elizaveta', 'home': 'Guarachi Mathison, Alexa'}
{'away': 'Shane, Ryan', 'home': 'Bester, Philip'}
{'away': 'Kalinina, Anhelina', 'home': 'Bouchard, Eugenie'}
{'away': 'Zarazua, Renata', 'home': 'Zaja, Anna'}
{'away': 'Ianchuk, Elizaveta', 'home': 'Guarachi Mathison, Alexa'}
{'away': 'Lin, Winston', 'home': 'Halebian, Alexios'}
{'away': 'Kalinina, Anhelina', 'home': 'Bouchard, Eugenie'}
{'away': 'Kalinina, Anhelina', 'home': 'Bouchard, Eugenie'}
{'away': 'Arconada, Usue Maitane', 'home': 'Lukas, Tena'}
{'away': 'Wu, Yibing', 'home': 'Mertens, Yannick'}
{'away': 'Shane, Ryan', 'home': 'Bester, Philip'}
{'away': 'Quigley, Eric', 'home': 'van Peperzeel, Gavin'}
{'away': 'Quigley, Eric', 'home': 'van Peperzeel, Gavin'}