summary refs log tree commit diff
diff options
context:
space:
mode:
authorBaitinq <manuelpalenzuelamerino@gmail.com>2025-01-03 19:00:54 +0100
committerBaitinq <manuelpalenzuelamerino@gmail.com>2025-01-03 19:00:54 +0100
commit29731d9c0fea248d7f7aab98bf9d752d28c2adf4 (patch)
tree2fbf0f1b5d7a12d154d00ebe4093f016576442e3
parentImprovements (diff)
downloadrenfe-29731d9c0fea248d7f7aab98bf9d752d28c2adf4.tar.gz
renfe-29731d9c0fea248d7f7aab98bf9d752d28c2adf4.tar.bz2
renfe-29731d9c0fea248d7f7aab98bf9d752d28c2adf4.zip
Accept train time as argv
-rw-r--r--main.py3
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)