I am trying to use https://asunnot.oikotie.fi/myytavat-asunnot
within iframe using Selenium in Python, but seem unable to locate the acceptance button for the cookie popup window.
Here's the code I built:
url = 'https://asunnot.oikotie.fi/myytavat-asunnot'
driver = webdriver.Safari()
driver.get(url)
driver.implicitly_wait(10)
button = driver.find_elements_by_class_name("button")
for ind, b in enumerate(button):
print(ind, b.text.strip())
button[53].click()
Image:
But I get the following error message:
selenium.common.exceptions.ElementNotInteractableException: Message:
When I inspect the elements in the driver, it seems it contains the page in the background, but not the cookie popup window. I also tried, if it would be an alert
, but it didn't seem to be.
Any ideas how to go forward?