I am using BeautifulSoup and parsing some HTMLs.
I\'m getting a certain data from each HTML (using for loop) and adding that data to a cert
Handling the exception is the way to go:
try: gotdata = dlist[1] except IndexError: gotdata = 'null'
Of course you could also check the len() of dlist; but handling the exception is more intuitive.
len()
dlist