Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

499
Vistas
Selenium (Python) error: element not interactable

I am trying to click on this particular web element from this site: https://www.milanofinanza.it/quotazioni/ricerca/listino-completo-2ae?refresh_cens

enter image description here

I have tried in many different ways but i still get the same error (element not interactable).

My code looks like this:

wd.find_element(By.XPATH,"//*[@id='mainbox']/div[2]/div[2]/div[4]/div/div[1]/div/button[4]").click()

The element is actually detected but for some reason it isn't clickable.

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

I can think of two possible explanations:

  1. The element you detected is not the element you think was detected. You're using a rather long XPATH, so I would be suspicious without external confirmation that you really selected the button you wanted. If the button you did select is disabled, then it will not be interactable.
  2. The button might not be clickable through the same method that selenium's .click() expects. I am not familiar with ng- attributes, so maybe it's just a language localization thing, but I suspect that selenium may be looking for an onclick attribute.

My suggestions:

  1. Instead of using a complicated XPATH, consider selecting by the inner text of the button. So something like this: //*button[text()=Successiva]
  2. Instead of using any xpath at all, just call the JavaScript function that is referenced in the button: getDataTableNextClick()
about 4 years ago · Juan Pablo Isaza Denunciar

0

wait=WebDriverWait(driver,20)
try:
    wait.until(EC.element_to_be_clickable((By.XPATH,"//li[@class='page-item']/button[.='Successiva']"))).click()
except:
    pass

To simply click on that element just look for the button with that text.

To go through 15 pages you could do

current=1
last=15
while True:
    try:
        if current == last:
            break
        current+=1
        wait.until(EC.element_to_be_clickable((By.XPATH,"//li[@class='page-item']/button[.='Successiva']"))).click()
    except:
        break

Now this site is a little trickier if you want to go pass the 15 pages since the pagination doesn't disable the button.

current="1"
old="2"
while True:
    try:
        if current == old:
            break
        old=current
        wait.until(EC.element_to_be_clickable((By.XPATH,"//li[@class='page-item']/button[.='Successiva']"))).click()
        current=wait.until(EC.visibility_of_element_located((By.XPATH,"//*[contains(@class,'page-item ng-scope active')]"))).text
    except:
        break

Import:

from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait 
from selenium.webdriver.support import expected_conditions as EC
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda