0

EDIT: This is NOT a duplicate of the other question. Stop flagging this!

I am facing problem while clicking a button which will open a new webpage. I have successfully got the option values(nested dropdowns) but when I click the CERCA button on the page ( https://www.struttureveterinarie.it/?q=ricercastruttureavanzata). It takes me to another page which is not the one I wanted to go to. When I tried using the Xpath.click, I get the message that element you are trying to click is not clickable and another element will be clicked. Following is the code I am using. Please let me know what am I doing wrong. I tried using Xpath, selector, name, ID, Partial text everything.

    from selenium import webdriver
    from selenium.common.exceptions import TimeoutException
    from selenium.webdriver.support.ui import WebDriverWait
    from selenium.webdriver.support import expected_conditions as EC
    from selenium.webdriver.common.by import By
    PATH=r'C:\Users\muzamal.pervez\Desktop\Python Scripts\chromedriver.exe'
    driver=webdriver.Chrome(PATH)
    driver.get('https://www.struttureveterinarie.it/?q=ricercastruttureavanzata')
    res2 = driver.execute_script("return document.documentElement.outerHTML")
    Select(driver.find_element_by_xpath('''//*[@id="province"]''')).select_by_visible_text(com['Province'][1])
    Select(driver.find_element_by_xpath('''//*[@id="comuni"]''')).select_by_visible_text(com['Community'][0])
    driver.find_element_by_partial_link_text("CERCA").click()

Your support will be highly appreciated. Thanks a lot :)

Muzamal Rana
  • 135
  • 1
  • 2
  • 12

0 Answers0