may even be stable wtf

This commit is contained in:
piair 2023-03-31 10:00:45 +02:00
parent f10cd8d226
commit 799d3d67d5
1 changed files with 17 additions and 21 deletions

20
V5.py
View File

@ -460,7 +460,7 @@ def login(ldriver):
ldriver.refresh() ldriver.refresh()
except WebDriverException as e: except WebDriverException as e:
if "Reached error page: about:neterror?e=netTimeout" in str(e): if "Reached error page: about:neterror?e=netTimeout" in str(e):
print("Timeout error occurred. \"normal\".....") print("Timeout error occurred. \"normal\"....., maybe because of mismatch date ? ")
log_error("test - 1", ldriver, True) log_error("test - 1", ldriver, True)
else: else:
log_error(e) log_error(e)
@ -471,27 +471,23 @@ def login(ldriver):
ldriver.refresh() ldriver.refresh()
rgpd_popup(ldriver) rgpd_popup(ldriver)
ldriver.get("https://www.bing.com/rewardsapp/flyout") ldriver.get("https://www.bing.com/rewardsapp/flyout")
if not('>Tableau de bord' in ldriver.page_source):
log_error(f"Not Connected 1. autre tag : {'>Tableau de bord' in ldriver.page_source}", ldriver, True)
ldriver.refresh()
log_error("Not Connected 2", ldriver, True)
if not('>Tableau de bord' in ldriver.page_source): if not('>Tableau de bord' in ldriver.page_source):
log_error("Not connected 3", ldriver, True) log_error("Not connected 3", ldriver, True)
try : try :
driver.find_element(By.CSS_SELECTOR, "[h='ID=RewardsFlyout,2.1']").click() ldriver.find_element(By.CSS_SELECTOR, "[h='ID=RewardsFlyout,2.1']").click()
custom_sleep(5) custom_sleep(5)
if "bing.com" in ldriver.current_url : if "bing.com" in ldriver.current_url :
log_error("connected 3.5", ldriver, True)
rgpd_popup(ldriver) rgpd_popup(ldriver)
driver.get("https://www.bing.com/rewardsapp/flyout") ldriver.get("https://www.bing.com/rewardsapp/flyout")
log_error("connected 4", ldriver, True) if ('>Tableau de bord' in ldriver.page_source) :
#return(True) return(True)
log_error("not connected 5", ldriver, True) else :
log_error("not connected 3", ldriver, True)
except Exception as e: except Exception as e:
log_error(f"not connected 5 - error {e}", ldriver) log_error(f"not connected 5 - error {e}", ldriver)
if not('>Tableau de bord' in ldriver.page_source): if not('>Tableau de bord' in ldriver.page_source):
try : try :
driver.find_element(By.XPATH, "/html/body/div/div/div/div/div[2]/a").click() ldriver.find_element(By.XPATH, "/html/body/div/div/div/div/div[2]/a").click()
except Exception as e: except Exception as e:
log_error(f"erreur not connected 6{e}", ldriver) log_error(f"erreur not connected 6{e}", ldriver)
log_error("not connected 6", ldriver, True) log_error("not connected 6", ldriver, True)