Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 13 additions & 14 deletions veolia-idf-domoticz.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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(
Expand All @@ -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,
Expand All @@ -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)

Expand Down