0

I am trying to find a button which has Quick Move-In as the content.

<li>
<a href="javascript:void(0);" class="active">
                            94 Quick Move-In Homes
<span class="len-tip-item bottom">
<i class="far fa-info-circle"></i> 
<span class="len-tip-box" style="display: none;">
An inventory home that is either under construction or completed.
</span></span></a></li>

My code looks like this.

driver.implicitly_wait(30)

python_button = driver.find_element_by_xpath("//a[contains(., 'Move-In')]")
python_button.click() #click link

I am not sure why am I getting this error: ElementClickInterceptedException: Message: Element is not clickable at point (1257,736) because another element obscures it

Srushti Parab
  • 31
  • 2
  • 8
  • Is that the entire error message? – AMC Feb 27 '20 at 01:20
  • 1
    Does this answer your question? [Selenium-Debugging: Element is not clickable at point (X,Y)](https://stackoverflow.com/questions/37879010/selenium-debugging-element-is-not-clickable-at-point-x-y) – AMC Feb 27 '20 at 01:21
  • Also: https://stackoverflow.com/questions/11908249/debugging-element-is-not-clickable-at-point-error?rq=1 – AMC Feb 27 '20 at 01:21
  • @AMC the first link helped. Thanks a lot!!! – Srushti Parab Feb 27 '20 at 01:30

1 Answers1

0

You will want to use a wait and wait for the element to be clickable before attempting to click it.

from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By    
from selenium.webdriver.support import expected_conditions as EC

driver.implicitly_wait(30)
python_button = WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, "//a[contains(., 'Move-In')]")))
python_button.click() #click link

You can use waits for wait for other expected conditions, as well. You can find more info here: https://selenium-python.readthedocs.io/waits.html

RKelley
  • 1,099
  • 8
  • 14