Thank you it was data["RaceDay"] that was needed.
ata = r.json()
if data["RaceDay"] is None:
print("Nothing here")
else:
print(data["RaceDay"])
Nothing here
Nothing here
Nothing here
{'MeetingDate': '2017-01-11T00:00:00', .
Thanks
Sayth
--
https://mail.python.org/m
On 09/27/2017 01:05 PM, Sayth Renshaw wrote:
Hi
I have got a successful script setup to rotate through dates and download json
data from the url.
As the api returns 200 whether successful I want to check if the file returned
is not successful.
when a file doesn't exist the api returns
{'Race
Sayth Renshaw writes:
> When I call data = r.json() it says its type is None if it is not
> successful so I thought it easier to check that.
Can you show the interactive session where you do that check?
>>> data = r.json()
>>> data is None
True
That's what I understand your stateme
Il 27/09/2017 22:05, Sayth Renshaw ha scritto:
Hi
I have got a successful script setup to rotate through dates and download json
data from the url.
As the api returns 200 whether successful I want to check if the file returned
is not successful.
when a file doesn't exist the api returns
{'Ra
Hi
I have got a successful script setup to rotate through dates and download json
data from the url.
As the api returns 200 whether successful I want to check if the file returned
is not successful.
when a file doesn't exist the api returns
{'RaceDay': None, 'ErrorInfo': {'SystemId': 200, 'Err