I am trying to click a button that is present on the right side of the graph(Three lines above the graph) and finally want to click on "Download as CSV". My code is as below.
from selenium.webdriver.support.ui import WebDriverWait
from selenium import webdriver
import time
from selenium.webdriver.chrome.options import Options
driver = webdriver.Chrome(executable_path= ChromeDriver_Path, options = options)
driver.get('https://www.kansascityfed.org/data-and-trends/labor-market-conditions-indicators/')
time.sleep(5)
element = WebDriverWait(driver, 20).until(EC.presence_of_element_located((By.XPATH, '//*[@id="highcharts-zn6tkt8-0"]/div[1]/div[2]/button'))).click() ##Error here
File = WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="highcharts-3slsa4f-0"]/div[2]/ul/li[6]'))).click() #Download as csv
Error: raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.TimeoutException
My XPath looks correct but still, the element is not getting clicked.