Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selenium-Debugging: Element is not clickable at point (X,Y)

I try to scrape this site by Selenium.

I want to click in "Next Page" buttom, for this I do:

 driver.find_element_by_class_name('pagination-r').click() 

it works for many pages but not for all, I got this error

WebDriverException: Message: Element is not clickable at point (918, 13). Other element would receive the click: <div class="linkAuchan"></div> 

always for this page

I read this question

and I tried this

driver.implicitly_wait(10) el = driver.find_element_by_class_name('pagination-r') action = webdriver.common.action_chains.ActionChains(driver) action.move_to_element_with_offset(el, 918, 13) action.click() action.perform() 

but I got the same error

like image 475
parik Avatar asked Jun 17 '16 10:06

parik


People also ask

How do you handle an element is not clickable at point?

The exception “Element is not clickable at point” might be thrown when the element is not under focus or the action is being performed on the incorrect WebElement. In such cases, you have to switch to the actual element and perform the click action.

Why is Selenium element not clickable?

This is because the element is present in DOM, but its position is not fixed on the page. Adding the explicit wait. The webdriver can wait till the expected condition - visibilityOf(webdriver shall wait for an element in DOM to be visible). Adding the explicit wait.

Is not clickable at point XY other element would receive the click?

The error “element is not clickable at point” is self-explanatory. It means that the element that you're trying to click on can't be clicked at that particular point. You'd usually find this error when you locate an element and try to execute a click action on it.

How do you check whether the element is clickable or not?

We can check if the element is clickable or not in Selenium webdriver using synchronization. In synchronization, there is an explicit wait where the driver waits till an expected condition for an element is met. To verify, if the element can be clicked, we shall use the elementToBeClickable condition.


2 Answers

Another element is covering the element you are trying to click. You could use execute_script() to click on this.

element = driver.find_element_by_class_name('pagination-r') driver.execute_script("arguments[0].click();", element) 
like image 68
RemcoW Avatar answered Sep 29 '22 09:09

RemcoW


I had a similar issue where using ActionChains was not solving my error: WebDriverException: Message: unknown error: Element is not clickable at point (5 74, 892)

I found a nice solution if you dont want to use execute_script:

    from selenium.webdriver.common.keys import Keys #need to send keystrokes      inputElement = self.driver.find_element_by_name('checkout')      inputElement.send_keys("\n") #send enter for links, buttons 

or

    inputElement.send_keys(Keys.SPACE) #for checkbox etc 
like image 32
Deepak Garud Avatar answered Sep 29 '22 10:09

Deepak Garud