Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

496
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!