Remove misleading stack trace when a button is not found

This commit is contained in:
ngosang 2023-08-03 05:45:38 +02:00
parent b4ad583baa
commit d1588c1156

View File

@ -264,8 +264,8 @@ def click_verify(driver: WebDriver):
actions.click(checkbox) actions.click(checkbox)
actions.perform() actions.perform()
logging.debug("Cloudflare verify checkbox found and clicked!") logging.debug("Cloudflare verify checkbox found and clicked!")
except Exception as e: except Exception:
logging.debug("Cloudflare verify checkbox not found on the page. Error: " + str(e)) logging.debug("Cloudflare verify checkbox not found on the page.")
finally: finally:
driver.switch_to.default_content() driver.switch_to.default_content()
@ -281,8 +281,8 @@ def click_verify(driver: WebDriver):
actions.click(button) actions.click(button)
actions.perform() actions.perform()
logging.debug("The Cloudflare 'Verify you are human' button found and clicked!") logging.debug("The Cloudflare 'Verify you are human' button found and clicked!")
except Exception as e: except Exception:
logging.debug("The Cloudflare 'Verify you are human' button not found on the page. Error: " + str(e)) logging.debug("The Cloudflare 'Verify you are human' button not found on the page.")
time.sleep(2) time.sleep(2)