I am looping over a data frame with a for loop entering in information. Each time information is entered. Name and id. The database will return the information if it exists else nothing will be returned. How do I write an exception for when no information is return.
mylist=[]
for i,j in df1.iterrows():
name = j[1]
age = j[2]
sleep(3)
n = input(name)
a = input(age)
mylist1=[]
result1= driver.find_element_by_css_selector("height")
result2 = driver.find_element_by_css_selector("id")
mylist1.append("height: ",result1)
mylist1.append("id: ",result2)
print(tokens)