From 0c197a6b9b961f3fa899ff406540a9225a1b8b57 Mon Sep 17 00:00:00 2001 From: Leon Date: Sat, 3 Jun 2023 02:39:06 +0200 Subject: [PATCH] Update test_workflow.py --- example/test_workflow.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/example/test_workflow.py b/example/test_workflow.py index 4407851..dbfa23a 100644 --- a/example/test_workflow.py +++ b/example/test_workflow.py @@ -50,29 +50,32 @@ def main(): #3## driver = uc.Chrome(headless=True, browser_executable_path=browser_executable_path) - logging.getLogger().setLevel(20) + logging.getLogger().setLevel(10) driver.get('https://www.nowsecure.nl') logger.info('current url %s' % driver.current_url) try: - WebDriverWait(driver,10).until(EC.title_contains('moment')) + WebDriverWait(driver,15).until(EC.title_contains('moment')) except TimeoutException: pass + logger.info('current page source:\n%s' % driver.page_source) logger.info('current url %s' % driver.current_url) try: - WebDriverWait(driver,10).until(EC.title_contains('nowSecure')) - except TimeoutException: - logging.getLogger().setLevel(20) + WebDriverWait(driver,15).until(EC.title_contains('nowSecure')) + logger.info('PASSED CLOUDFLARE!') + + except TimeoutException: + logger.info('timeout') print(driver.current_url) - else: - logger.info( "PASSED CLOUDFLARE! ") + + logger.info('current page source:\n%s' % driver.page_source) - + logging.getLogger().setLevel(20) logger.info('trying to save a screenshot via imgur') # driver.reconnect() driver.save_screenshot('/tmp/screenshot.png')