From 29731d9c0fea248d7f7aab98bf9d752d28c2adf4 Mon Sep 17 00:00:00 2001 From: Baitinq Date: Fri, 3 Jan 2025 19:00:54 +0100 Subject: Accept train time as argv --- main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) -- cgit 1.4.1