I'm automating a bot to book a certain time (preferred time and second preferred time). I need help to use if else statement to allow the browser to search for the preferred time and if not present to search for the second preferred time.
Below is my code:
preferred_time=driver.find_element(By.XPATH,'//div[@class="booking-start-time-label"][contains(., "12:33pm")]')
preferred_time.click()
second_preferd_time= driver.find_element(By.XPATH,'//div[@class="booking-start-time-label"][contains(., "1:33pm")]')
second_preferd_time.click()