From 7c4de0ff5d0910bedaf43fbf73c6084986803af4 Mon Sep 17 00:00:00 2001 From: piair338 Date: Sun, 16 Oct 2022 17:39:38 +0000 Subject: [PATCH] ouio# Please enter the commit message for your changes. Lines starting --- V4.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/V4.py b/V4.py index 0add38d..a61da5b 100755 --- a/V4.py +++ b/V4.py @@ -182,13 +182,19 @@ def claim_amazon(): box.send_keys(code) driver.find_element(By.XPATH, "//span[contains( text( ), 'Déverrouillez votre récompense')]").click() sleep(5) - fcode = driver.find_element(By.XPATH, "/html/body/div[1]/div[1]/main/div/div/div/div/div[1]/div/div[1]/div[2]/div[2]/div/div/div/div/div/div[2]/span").get_attribute("innerHTML") #amazon = search("> ([^ ]+) <", fcode)[1] - webhookSuccess.send(_mail +" - "+ fcode) + driver.refresh() + fcode = driver.find_element(By.XPATH, "/html/body/div[1]/div[1]/main/div/div/div/div/div[1]/div/div[1]/div[2]/div[2]/div/div/div/div/div/div[2]/span").get_attribute("innerHTML") + CustomSleep(10) + if fcode : + webhookSuccess.send(_mail +" - "+ fcode) + else : + LogError("impossible de localiser le code ") + else : LogError("la recuperation ne peux pas être automatique") except Exception as e : - LogError('problème dans la recuperation' + e) + LogError(f'problème dans la recuperation : {e}')