I am trying to close the popup iframe to do web scraping in the aliexpress, but I can't access my image to click it
import os
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
option = Options()
option.set_headless(True)
profile = webdriver.FirefoxProfile()
profile.set_preference('intl.accept_languages', 'fr')
def webscraping_aliexpress():
driver = webdriver.Firefox(executable_path=f"{os.getcwd()}\geckodriver.exe", firefox_profile=profile)
driver.get(str(input("Paste aliexpress url: ")))
name = driver.find_element_by_xpath("//h1[@class='product-title-text']").text
price = driver.find_element_by_xpath("//div[@class='product-price-current']").text
WebDriverWait(driver, 20).until(EC.frame_to_be_available_and_switch_to_it((By.XPATH, "//iframe[@data-spm-anchor-id='a2g0o.detail.0.i4.4bc257b6555T2w'")))
WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//img[@class='rax-image ']"))).click()
webscraping_aliexpress()
I can extract some of the data, like name and price before the popup shows on, but he blocks other operations after.