diff --git a/V5.py b/V5.py index ebcc571..464efa4 100755 --- a/V5.py +++ b/V5.py @@ -36,6 +36,7 @@ def firefox_driver(mobile=False, headless=False): if proxy_enabled : setup_proxy(proxy_address,proxy_port, options) options.set_preference("browser.link.open_newwindow", 3) + options.set_preference("dom.confirm_repost.testing.always_accept", True) if FAST : options.set_preference("permissions.default.image", 2) #disable image loading. You shouldn't use it except if really nessecary if headless: @@ -228,6 +229,8 @@ def all_cards(): # return to the main page and closes all other tabs printf(f"fermeture : {driver.current_url}") driver.close() driver.switch_to.window(driver.window_handles[0]) + if driver.current_url != "https://www.bing.com/rewardsapp/flyout": + driver.get("https://www.bing.com/rewardsapp/flyout") reset(part2) def daily_cards(): # cartes de la premiere partie (renouvelées chaque jours). @@ -296,7 +299,7 @@ def all_cards(): # return to the main page and closes all other tabs for _ in range(10): try : driver.find_element(By.XPATH, "/html/body/div/div/div[3]/div[1]/div/div[1]/div[2]").click() - close_tab(driver.window_handles[1]) + reset() except Exception as e: print(format_error(e)) break @@ -793,6 +796,11 @@ def daily_routine(custom = False): except Exception as e: log_error(e) + try: + fidelity() + except Exception as e: + log_error(e) + try: bing_pc_search() except Exception as e: @@ -803,10 +811,6 @@ def daily_routine(custom = False): except Exception as e: log_error(e) - try: - fidelity() - except Exception as e: - log_error(e) try: log_points(_mail) diff --git a/modules/tools.py b/modules/tools.py index 80bfab5..cc4cde4 100644 --- a/modules/tools.py +++ b/modules/tools.py @@ -50,7 +50,7 @@ def format_error(e) -> str: tb = e.__traceback__ txt = "" while tb != None : - txt = txt + f" ({tb.tb_lineno}) -> {tb.tb_frame.f_code.co_name}" + txt = txt + f" -> {tb.tb_frame.f_code.co_name} ({tb.tb_lineno}) " tb = tb.tb_next return(txt + "\n" + str(e))