when I click on an image manually, the new page loads, and the new page is stable.
When I click via selenium in python, the new page loads for a few seconds and then returns to the previous page automatically for an unknown reason, so I can't capture the elements of the new page.
The first click is on this img:
<span class="option center" id="FXS_edit">
<img src="../img/edit.png" title="Editar">
</span>
The new page has a table call "extensions_table", and i want to retrive the "value='558131835426'"
<table id="extensions_table" class="form">
<thead>
<tr>
</tr>
</thead>
<tbody id="kextensionsitemsform">
<tr class="highlight">
<td><input type="checkbox" value="0" checked="">0</td>
<td><input type="text" value="558131835426" maxlength="15" autocomplete="off"></td>
<td><input class="user_ext" type="text" value="558131835426"></td>
<td><input class="pwd_ext" type="password" value="Asd123!."></td>
</tr>
My code:
chrome_options = Options()
chrome_options.add_argument("--start-maximized")
chrome_options.BinaryLocation = os.getcwd() + os.sep + "chrome.exe" + \
os.sep + "chrome.exe"
driver = webdriver.Chrome(options=chrome_options)
driver.get("http://login:passwd@IP Address")
driver.find_element(By.CSS_SELECTOR, "#FXS_edit").click()
sleep(2)
table_id = driver.find_element(By.XPATH,'/html/body/div[1]/div[3]/div/div[5]/fieldset/div[2]/div[1]/div/form/table')
/html/body/div[1]/div[3]/div/div[5]/fieldset/div[2]/div[1]/div/form/table
#or
table_id = driver.find_element(By.ID, "extensions_table")
I get the Message:
NoSuchElementException: Message: no such element: Unable to locate element
cause the new page is not on the screen anymore, it's already returned to the previous page
How do I make the new page stable, just like running the page manually?
I tried different ways to click the img, but the same pattern repeats.