I am using following code to download the excel from this web site, the code was working fine but recently the web page may change so my code doesn't work. It returns this error:
selenium.common.exceptions.ElementClickInterceptedException: Message: Element is not clickable at point (1250,464) because another element obscures it
Here is the code:
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
geckodriver = '/opt/geckodriver'
options = webdriver.FirefoxOptions()
options.add_argument('-headless')
driver = webdriver.Firefox(executable_path=geckodriver, firefox_options=options)
driver.get('https://www.hkex.com.hk/Market-Data/Futures-and-Options-Prices/Equity-Index/Hang-Seng-Index-Futures-and-Options?sc_lang=en#&product=HSI')
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.ID, 'ete'))).click()
time.sleep(2)
html = driver.page_source
print(html)
I searched the posts in stackoverflow, I found that I can use ActionChains but I dunno how to apply to until(EC.element_to_be_clickable((By.ID, 'ete')))
ActionChains(driver).move_to_element(element).click().perform()