How can I find the highlighted element in the following html structure.
This is the code that I'm using.
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
browser = webdriver.Edge()
browser.implicitly_wait(5) # seconds
browser.get(url) # aspx page
browser.find_element_by_id("LoginBtn").click()
browser.find_element_by_id("ReportingMenuName").click()
browser.find_element_by_id("EndpointDataExportSubmenuName").click()
browser.find_element_by_id("EndpointDataExportMenuItem").click()
browser.switch_to_default_content()
browser.switch_to.frame(browser.find_element_by_id("main"))
element = WebDriverWait(browser, 10).until(EC.presence_of_element_located(\
(By.ID, "ct100_PageBody_OkButton")))
element.click()
When I run the code I get this error when it reaches the last 2 lines of code: TimeoutException
If I change the last 2 lines of code for this, then I get another error.
browser.find_element_by_id("ct100_PageBody_OkButton").click()
NoSuchElementException: No such element