I need to find class="a-icon a-icon-addon couponBadge" on Amazon page, like this. If the class exist, i need to set variable x == 0, if it doesn't exist, i need to set variable x == 1.
I tried this code, but it doesn't work. How can i check this?
try:
couponBadge = driver.find_elements_by_class_name("a-icon a-icon-addon couponBadge")
if couponBadge != None:
x == 0
else:
x == 1
except AttributeError:
print("error")