1

I am trying to conclude my bot. I need to click on the follow button in the follower page on instagram.com/user but when I run my program I get the error that there are other element the will receive the click. In fact I want all the element to recieve the click so I will be able to start following people.

This is my code :

#look on the followers page
driver.find_element_by_partial_link_text('follower').click()
sleep(3)

start following followers

for each in driver.find_elements_by_css_selector('.L3NKy'):
        driver.find_element_by_css_selector('.L3NKy').click()

Terminal Error :

selenium.common.exceptions.WebDriverException: Message: unknown error: Element <button class="BY3EC  oF4XW sqdOP  L3NKy      ">...</button> is not clickable at point (633, 155). Other element would receive the click: <div>...</div>

Thank you for your help

Luca C
  • 79
  • 11

1 Answers1

0

Other Element would receive the click can be resolved using JavaScriptExecutor Interface.

// Assume driver is a valid WebDriver instance that
// has been properly instantiated elsewhere.
WebElement element = driver.findElement(By.cssSelector("gbqfd"));
JavascriptExecutor executor = (JavascriptExecutor)driver;
executor.executeScript("arguments[0].click();", element);

I have written this code using Java, You can try the same using Python.

Purendra Agrawal
  • 558
  • 1
  • 6
  • 17