Quantcast
Viewing all articles
Browse latest Browse all 14126

I cannot click an Xpath element - Selenium ( v. 4.2 or higher) - Python

I am trying to draw data from a government website related to air quality and other statistical data. I am trying to automate the data retrieval process. However, following the entry into the data drawing page by 'Tiklama2' I was not able to click any elements.

Tiklama = driver.find_element(By.XPATH, '//*[@id="dropdown3-contentDataDowloadNew"]/div/div/div/div/span[3]')Tiklama.click()

The above code just doesn't work...

The code is below and there is no need to hide the URL or anything:

from selenium import webdriverimport timefrom selenium.webdriver.common.keys import Keysfrom selenium.webdriver.chrome.service import Servicefrom selenium.webdriver.common.by import Byservice = Service()options = webdriver.ChromeOptions()driver = webdriver.Chrome(service=service, options=options)driver.get("https://www.havaizleme.gov.tr/")driver.fullscreen_window()time.sleep(10)Tiklama2 = driver.find_element(By.XPATH, '//*[@id="Harita"]/div[1]/a[5]')Tiklama2.click()time.sleep(100)Tiklama = driver.find_element(By.XPATH, '//*[@id="dropdown3-contentDataDowloadNew"]/div/div/div/div/span[3]')Tiklama.click()driver.quit()

Viewing all articles
Browse latest Browse all 14126

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>