From b7f3bd053a0083f7173d3d9b2d4f890e806941f8 Mon Sep 17 00:00:00 2001 From: piair Date: Thu, 9 Jun 2022 14:36:51 +0200 Subject: [PATCH] =?UTF-8?q?fallback=20fidelit=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- V4.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/V4.py b/V4.py index 6a9d181..161360d 100755 --- a/V4.py +++ b/V4.py @@ -895,9 +895,13 @@ def Fidelite(): if (lien.split(":")[0] == "https") or (lien.split(":")[0] == "http") : driver.get(lien) - sleep(2) - choix = driver.find_element(By.CSS_SELECTOR, 'div[class="pull-left spacer-48-bottom punchcard-row"]') # pull-left spacer-48-bottom punchcard-row? USELESS ? - + CustomSleep(5) + try : + choix = driver.find_element(By.CSS_SELECTOR, 'div[class="pull-left spacer-48-bottom punchcard-row"]') # pull-left spacer-48-bottom punchcard-row? USELESS ? + except : + CustomSleep(300) + choix = driver.find_element(By.CSS_SELECTOR, 'div[class="pull-left spacer-48-bottom punchcard-row"]') # pull-left spacer-48-bottom punchcard-row? USELESS ? + nb = search("([0-9]) of ([0-9]) completed", driver.page_source) if not nb: nb = search("([0-9]) de ([0-9]) finalisé", driver.page_source)