diff options
author | Baitinq <manuelpalenzuelamerino@gmail.com> | 2025-01-03 19:00:54 +0100 |
---|---|---|
committer | Baitinq <manuelpalenzuelamerino@gmail.com> | 2025-01-03 19:00:54 +0100 |
commit | 29731d9c0fea248d7f7aab98bf9d752d28c2adf4 (patch) | |
tree | 2fbf0f1b5d7a12d154d00ebe4093f016576442e3 | |
parent | Improvements (diff) | |
download | renfe-29731d9c0fea248d7f7aab98bf9d752d28c2adf4.tar.gz renfe-29731d9c0fea248d7f7aab98bf9d752d28c2adf4.tar.bz2 renfe-29731d9c0fea248d7f7aab98bf9d752d28c2adf4.zip |
Accept train time as argv
-rw-r--r-- | main.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/main.py b/main.py index 11f3093..e98ce95 100644 --- a/main.py +++ b/main.py @@ -4,6 +4,7 @@ from selenium.webdriver.chrome.options import Options from time import sleep import logging import os +import sys from dotenv import load_dotenv @@ -83,7 +84,7 @@ def main_loop(driver): while True: # if this is not found, then we presume we have to login again try: - row = driver.find_element(By.XPATH, f"//tr[td[contains(text(), '18.50')]]") + row = driver.find_element(By.XPATH, f"//tr[td[contains(text(), '{sys.argv[1]}')]]".format()) except Exception: loginRenfe(driver) navigate_to_tickets(driver) |