I have the following code:
driver.find_element(By.XPATH, "/html/body/...").text
However, the element I am looking for is optional. It will sometimes be present and sometimes not. I want to keep track whether it is present. If it is not present, the code should not be terminated because driver.find_element throws a the NoSuchElementException
error. I want to code to continue.