0

I am trying to click on button that will allow to me download a cdv in order to run daily checks, but the moment I tried to do it it thrown me an error like this

ElementNotInteractableException: Message:

this is my code:

import selenium

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

driver = webdriver.Safari()

driver.get('https://xxxxxxxxxx')

id_box = driver.find_element_by_xpath("//input[@id='ap_email']")

Send id information

id_box.send_keys('xxxxxx')

pass_box = driver.find_element_by_xpath("//input[@id='ap_password']")

pass_box.send_keys('xxxxxxx')

Find login button

login_button = driver.find_element_by_xpath("//input[@id='signInSubmit']")

Click login

login_button.click()

wait = WebDriverWait(driver, 10)

element = wait.until(EC.element_to_be_clickable((By.CLASS_NAME,"tours-controls__export")))

element.click()

I TRIED ALSO:

from selenium.webdriver.support.ui import WebDriverWait

from selenium.webdriver.support import expected_conditions as EC

WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//a[contains(text(),'Export')]"))).click()

AND :

ele = driver.find_element_by_xpath("//body/div[@id='body-wrapper']/main[@id='main-wrapper']/div[@id='application']/div1/div[2]/div1/div1/div[2]/div[4]/span1/span1")

but still the same error.

Below the html: enter image description here

Export

when I click manually it change adding "disabled"

Export

1 Answers1

0

ElementNotInteractableException occurs when an element is found, but you can't be interacted with. For instance, you may not be able to click or send keys. This could happen due to various reasons like element being not visible or displayed, element is off screen or element is behind another element or hidden. So, you can perform some of the actions to make element interactable:

Check for overlays, check that element is displayed, (not in a "collapsed" or hidden state).

element_to_be_clickable doesn't mean it is actually "clickable" if you will. It checks some factors (non-zero size, not disabled, etc) but isn't a guarantee that the element will succeed a click.

Check to make sure the element is actually present on the rendered page.

DMart
  • 2,401
  • 1
  • 14
  • 19