I use a nested for loop to get data of Weekdays. If one of the days is 'null' the loop stops at that day and doesn't get the rest of the days. I believe that I need to use some 'if' statement at some point but it still doesn't work for me after many tries.
Here are the code I use before trying if statements:
try:
Sunday = []
Monday = []
Tuesday = []
Wednesday = []
Thursday = []
Friday = []
Saturday = []
for i in data[1][2]:
for j in i[1]:
for x in str(j[1]).split(', '):
if i[0] == 7:
Sunday.append(x)
elif i[0] == 1:
Monday.append(x)
elif i[0] == 2:
Tuesday.append(x)
elif i[0] == 3:
Wednesday.append(x)
elif i[0] == 4:
Thursday.append(x)
elif i[0] == 5:
Friday.append(x)
elif i[0] == 6:
Saturday.append(x)
except:
If i[1] value are null at any day of the weekdays, the scraper doesn't get that day nor the days after it. I tried to use if statement to check if j is null and continue but still does not work for me.