diff --git a/colocrossing_api.py b/colocrossing_api.py index 9398869..fb941ec 100644 --- a/colocrossing_api.py +++ b/colocrossing_api.py @@ -1,9 +1,12 @@ # colocrossing_api.py from selenium import webdriver from selenium.webdriver.support.ui import Select +from selenium.webdriver.chrome.options import Options # Initialize the WebDriver (make sure you have the appropriate WebDriver installed) -driver = webdriver.Chrome() # You can use other WebDriver options like Firefox, Edge, etc. +chrome_options = Options() +chrome_options.add_argument('--headless') +driver = webdriver.Chrome(options=chrome_options) # You can use other WebDriver options like Firefox, Edge, etc. # URL for login login_url = "https://portal.colocrossing.com/auth/login" @@ -52,7 +55,7 @@ def power_cycle(credentials, device_id): # Set the select with name control_action to option 1 select = driver.find_element(by="name", value="control_action") select_option = Select(select) - select_option.select_by_value("1") + select_option.select_by_value("3") # Click the button with class control_pdu_port_button button = driver.find_element(by="class name", value="control_pdu_port_button")