diff --git a/veolia-idf-domoticz.py b/veolia-idf-domoticz.py index e2faf51..58e34ca 100755 --- a/veolia-idf-domoticz.py +++ b/veolia-idf-domoticz.py @@ -170,7 +170,6 @@ def print(self, string="", st=None, end=None): # Object that retrieve the historical data from Veolia website ################################################################################ class VeoliaCrawler: - # site_url = "https://espace-client.vedif.eau.veolia.fr/s/login/" site_url = "https://connexion.leaudiledefrance.fr/espace-particuliers/s/login/" download_filename = "historique_jours_litres.csv" @@ -689,11 +688,11 @@ def get_file(self): ### COMPORTEMENT DIFFERENT S'IL S AGIT D'UN MULTI CONTRATS ### OU D'UN CONTRAT UNIQUE (CLICK DIRECTEMENT SUR HISTORIQUE) - self.print("Wait for MENU contrats or historique", end="") + self.print("Wait for MENU Consommation or Tous mes contrats", end="") ep = EC.visibility_of_element_located( ( By.XPATH, - "//span[contains(text(), 'Contrats') or contains(text(), 'Historique')]", + "//span[contains(text(), 'Tous mes contrats') or contains(text(), 'Consommation')]", ) ) el = self.__wait.until( @@ -716,7 +715,7 @@ def get_file(self): self.print(st="ok") # GESTION DU PARCOURS MULTICONTRATS - if menu_type == "Contrats": + if menu_type == "Tous mes contrats": time.sleep(2) self.click_in_view( By.XPATH, @@ -728,17 +727,17 @@ def get_file(self): delay=0, ) - time.sleep(2) + time.sleep(2) - ###### Click Historique ##### - self.click_in_view( - By.XPATH, - r"//*[(self::a and text()='Historique')" - r" or (self::span and contains(text(), 'Historique'))]", - wait_message="Wait for historique menu", - click_message="Click on historique menu", - delay=4, - ) + ###### Click Historique ##### + self.click_in_view( + By.XPATH, + r"//*[(self::a and text()='Historique')" + r" or (self::span and contains(text(), 'Historique'))]", + wait_message="Wait for historique menu", + click_message="Click on historique menu", + delay=10, + ) time.sleep(10)