Skip to content

Conversation

@s0nik42
Copy link
Contributor

@s0nik42 s0nik42 commented Dec 31, 2025

Salut,

J'ai fixé un certain nombre d'issues, 2 sont décrites dans des issues, et la 3ieme est décrite ci-dessous.

A ta dispo ci-besoin, est ce que tu penses que tu peux les merger rapido ? car j'ai l'impression que HA retélécharge depuis ton repo tout le temps ?

Thanks,

J'ai switché sur HA recemment et j'utlise maintenant ton code à la place du mien. J'ai un PB qui étrangement n'a pas l'air de te toucher. Chez moi la ' est invalid. Je te propose un patch un peu lazy mais qui fonctionne.

2025-12-31 14:55:15,645 : OK : Remove temporary download file '/config/historique_jours_litres.csv'.
2025-12-31 14:55:15,681 : WW :  Traceback (most recent call last): -   File "MetersToHA/apps/meters_to_ha/meters_to_ha.py", line 4192, in doWork -     veolia_file = crawler.get_veolia_idf_file() -                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -   File "MetersToHA/apps/meters_to_ha/meters_to_ha.py", line 1671, in get_veolia_idf_file -     self.__wait.until( -   File "/usr/lib/python3.12/site-packages/selenium/webdriver/support/wait.py", line 113, in until -     value = method(self._driver) -             ^^^^^^^^^^^^^^^^^^^^ -   File "/usr/lib/python3.12/site-packages/selenium/webdriver/support/expected_conditions.py", line 184, in _predicate -     return _element_if_visible(driver.find_element(*locator)) -                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -   File "/usr/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 802, in find_element -     return self.execute(Command.FIND_ELEMENT, {"using": by, "value": value})["value"] -            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -   File "/usr/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 432, in execute -     self.error_handler.check_response(response) -   File "/usr/lib/python3.12/site-packages/selenium/webdriver/remote/errorhandler.py", line 232, in check_response -     raise exception_class(message, screen, stacktrace) - selenium.common.exceptions.InvalidSelectorException: Message: invalid selector: Unable to locate an element with the xpath expression //span[contains(text(), 'Alertes de consommation') or contains(text(), 'Contrats') or contains(text(), 'consulter l') or contains(translate(text(), "CLH", "clh"), "consulter l)] because of the following error: - SyntaxError: Failed to execute 'evaluate' on 'Document': The string '//span[contains(text(), 'Alertes de consommation') or contains(text(), 'Contrats') or contains(text(), 'consulter l') or contains(translate(text(), "CLH", "clh"), "consulter l)]' is not a valid XPath expression. -   (Session info: chrome=142.0.7444.59); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#invalidselectorexception -

@s0nik42 s0nik42 changed the title Fix: Lazy patch of invalid XPath expression Fix: 3 bugs Jan 1, 2026
@s0nik42
Copy link
Contributor Author

s0nik42 commented Jan 9, 2026

@mdeweerd hello buddy, tu peux jeter un coup d'oeil? ayant migré sur HA, je vais rediriger les utilisateurs de veolia-idf sur ce repo si c'est bon pour toi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant