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
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.
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.
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.
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.
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)
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With