Skip to content Skip to sidebar Skip to footer

Selenium Does Not Get Elements Loaded Later

I have been trying to make a python script that will log into my router's page, log all the connected devices, and then display them by their connected names. I have made a script

Solution 1:

You need something like this:

try:
    # Load page
    browser.get("http://192.168.1.1/index.html")
    # Wait 10 seconds before element can be located on the page# For example, <div class="example"> -- first div with class "example"
    WebDriverWait(browser, 10).until(EC.presence_of_element_located((By.XPATH, ".//div[@class='example'][1]")))
except Exception as e:
    # Catch an exception in case of element unavailabilityprint ("Page load error: {}".format(e.message))

Solution 2:

Found another way to get connected devices list. Modem has a ConnectionStatus page where it gives me a full list including mac addresses and other details in a single string. Now I need to parse them. Will create another question about that.

Post a Comment for "Selenium Does Not Get Elements Loaded Later"