Dont error if vaccination data isnt available
This commit is contained in:
parent
9fc5ec5573
commit
1a62dea5ae
@ -80,7 +80,10 @@ def get_vaccination_data(location):
|
|||||||
cols = [ele.text.strip() for ele in cols]
|
cols = [ele.text.strip() for ele in cols]
|
||||||
data.append([ele for ele in cols if ele]) # Get rid of empty values
|
data.append([ele for ele in cols if ele]) # Get rid of empty values
|
||||||
|
|
||||||
state_name, num_vaccinated, population, percent_vaccinated = list(filter(lambda x: x[0] == location, data))[0]
|
try:
|
||||||
|
state_name, num_vaccinated, population, percent_vaccinated = list(filter(lambda x: x[0] == location, data))[0]
|
||||||
|
except Exception:
|
||||||
|
return "Not available for %s" % location
|
||||||
return percent_vaccinated
|
return percent_vaccinated
|
||||||
|
|
||||||
def parse_message(message):
|
def parse_message(message):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user