Answer the question
In order to leave comments, you need to log in
[[+content_image]]
How to get the desired value from the string?
I don’t know how to get only the name of the bet and the coefficient from the line
["pinnacle","update_markets","PINTN97C6CD59FD7","9122741,0",[["TOTALS__OVER(22.5)",0,"1.806","","{\"key\":\"s;0;ou;22.5\",\"market_name\":\"totals\",\"dest\":\"over\",\"matchup_id\":1436579810,\"league_id\":6869,\"parent_id\":1435648317,\"participant_id\":null,\"is_special\":false}"],["TOTALS__UNDER(22.5)",0,"2.02","","{\"key\":\"s;0;ou;22.5\",\"market_name\":\"totals\",\"dest\":\"under\",\"matchup_id\":1436579810,\"league_id\":6869,\"parent_id\":1435648317,\"participant_id\":null,\"is_special\":false}"]
Answer the question
In order to leave comments, you need to log in
import json
s = r'["pinnacle","update_markets","PINTN97C6CD59FD7","9122741,0",[["TOTALS__OVER(22.5)",0,"1.806","","{\"key\":\"s;0;ou;22.5\",\"market_name\":\"totals\",\"dest\":\"over\",\"matchup_id\":1436579810,\"league_id\":6869,\"parent_id\":1435648317,\"participant_id\":null,\"is_special\":false}"],["TOTALS__UNDER(22.5)",0,"2.02","","{\"key\":\"s;0;ou;22.5\",\"market_name\":\"totals\",\"dest\":\"under\",\"matchup_id\":1436579810,\"league_id\":6869,\"parent_id\":1435648317,\"participant_id\":null,\"is_special\":false}"]'
data = json.loads(s+']]')
print(data[4][0][0])
print(data[4][0][2])
TOTALS__OVER(22.5)
1.806
import json
s = r'["pinnacle","update_markets","PINTN97C6CD59FD7","9122741,0",[["TOTALS__OVER(22.5)",0,"1.806","","{\"key\":\"s;0;ou;22.5\",\"market_name\":\"totals\",\"dest\":\"over\",\"matchup_id\":1436579810,\"league_id\":6869,\"parent_id\":1435648317,\"participant_id\":null,\"is_special\":false}"],["TOTALS__UNDER(22.5)",0,"2.02","","{\"key\":\"s;0;ou;22.5\",\"market_name\":\"totals\",\"dest\":\"under\",\"matchup_id\":1436579810,\"league_id\":6869,\"parent_id\":1435648317,\"participant_id\":null,\"is_special\":false}"]'
data = json.loads(s+']]')
# print(data[4][0][0])
# print(data[4][0][2])
for x in data[4]:
print(x[0] +' - '+ x[2])
TOTALS__OVER(22.5) - 1.806
TOTALS__UNDER(22.5) - 2.02
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question