I'm using Python 3.9, chromedriver 101 and the latest version of Selenium I'm trying to select and click an element within a frame without an ID. The HTML for the frame and element I want to click on are
<iframe title="false" class="k-content-frame" src="https://publisher.content2classroom.com/viewer.html#viewPublisherInstitutions?winId=ManagePublisherInstitutions" allowfullscreen="" frameborder="0">This page requires frames in order to show content</iframe>
...
<span id="subpageBackTitle" class="subpage-back-title">< back</span>
I have the following Python, which fails to select the element when it's visible
self.driver.switch_to.default_content()
...
element = WebDriverWait(self.driver, 5).until(EC.element_to_be_clickable((By.CSS_SELECTOR, ".subpage-back-title")))
The resulting error is
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/selenium/webdriver/support/wait.py:89: TimeoutException
What's the proper way to navigate to the frame and select/click on the element in question?