Trying to access this iframe but cannot seem to target it. While using xpath I have to use contain as the iframe id is always changing the last numbers.
<iframe id="cardinal-stepUpIframe-1659117883889" src="about:blank" frameborder="0" name="cardinal-stepUpIframe-1659117883889"></iframe>
I currently have the following code to try and access the iframe. I have tried accessing it via //* which does not seem to work either.
newiframe = WebDriverWait(driver,20).until(EC.presence_of_element_located((By.XPATH,"//iframe[contains(@id, 'cardinal-stepUpIframe')]")))
driver.switch_to.frame(newiframe)
print('switched to frame')
Any help would be great, thanks.