I'm looking to scrape data from a webpage using python and selenium. There is a csv download option which is visible only after a right click in the frame of the graph. I am not able to right click on the page and click on csv - download option using selenium. Here is the link for web page from where I am trying to get data - https://datastudio.google.com/reporting/d97f5736-2b85-4f39-beba-6dc386c24429/page/Z3ToB Have tried following set of code to do that:
options = webdriver.ChromeOptions()
options.binary_location = r"<Path where chrome application is installed>"
driver = webdriver.Chrome(r"<path to chrome driver>",chrome_options=options)
driver.get("https://datastudio.google.com/reporting/d97f5736-2b85-4f39-beba-6dc386c24429/page/Z3ToB")
timeout = 10
from selenium.webdriver import ActionChains
action = ActionChains(driver)
action.move_to_element(driver.find_element_by_xpath("//lego-canvas-container[@class='lego-canvas-container']")).perform()
action.context_click().perform()
Using this, not able to find the given XPATH, even tried with class name like report area. Could anyone guide about how to right click on anywhere in the frame and then find the download csv option within that?
