Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

497
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda