Is it possible to use an OR statement with WebDriverWait
? Basically I want the code to look for a UPC product code OR a Not Found statement. Only one or the other will show up on the website, so as soon as it finds either I want to to do something. If it finds the UPC I want it to click on it. If it finds the Not Found statement, I want it to append the UPC that wasn't found to a list. Below is the snippet of code from my larger For Loop. I'd prefer not to wait for the 10 with an else statement, but sometimes the search function on the website does load slower, so it's nice to have that larger 10 timer.
WebDriverWait(driver, 10).until(ec.visibility_of_element_located((By.XPATH,'//*[@id="'+upc+'"]' OR '/html/body/app-root/div/crf-report-route-entry/crf-report-page/div/div[2]/crf-data-selector-panel/crf-navigation-list/div[2]/p')))