3

when running this command, I'm getting an error:

driver.find_element_by_link_text("Confirm").click()

selenium.common.exceptions.WebDriverException: Message: unknown error: Element <a href="javascript:void(0);" class="c-button u-fontSize13 c-button--blue transparent-button js-connect-button js-request-connection" data-href="https://angel.co/user_graph_requests" data-invited-id="5911955">...</a> is not clickable at point (67, 581). Other element would receive the click: `<div class="mfp-container mfp-ajax-holder mfp-s-loading">...</div>`

After searching answers on this issue, I've changed the above code to:

element = driver.find_element_by_link_text("Confirm").click()
driver.execute_script("arguments[0].click();", element)

For the first click it worked and then printed this error:

selenium.common.exceptions.WebDriverException: Message: unknown error: Cannot read property 'click' of null

The HTML code is:

<a href="javascript:void(0);" class="c-button js-close s-vgLeft0_5 c-button--blue" data-modal="true" data-url="https://angel.co/user_graph_requests/102006082/verify">Confirm</a>
2
  • apparently when you try to click it here: driver.find_element_by_link_text("Confirm").click() your link is behind other element. That means you have somehow to bring your element to frontend. This can mean many things (like the page is not fully loaded) without any other info about that is kind of hard to say exactly what's going on Commented Jun 8, 2017 at 14:38
  • Try to give wait before the click() Commented Jun 8, 2017 at 14:39

4 Answers 4

3

So this worked for me:

driver.find_element_by_link_text("Confirm").send_keys('\n')

Thanks to everybody :)

Sign up to request clarification or add additional context in comments.

Comments

1

Try to search for the class:
driver.find_element_by_class("c-button js-close s-vgLeft0_5 c-button--blue").click()

1 Comment

she finds the click, the problem is that other element will receive the click because it is masked by other element.
0

If you look at the error message, you will see that another element is intercepting the click. I don't know for sure without looking at the page but generally it's something like a loader screen, popup, etc. that appears temporarily and then disappears. There is also the hint of one of the classes of the intercepting DIV, mfp-s-loading, that further makes me think it's some sort of loading popup. The problem here is that the script proceeds and tries to click the link faster than the popup loads and unloads. What I typically do in a situation like this is to wait for the popup to be invisible and then click the link.

The HTML of the popup is in the error message,

<div class="mfp-container mfp-ajax-holder mfp-s-loading">...</div>

So you can locate the element using a CSS selector like, div.mfp-s-loading, to wait for it to be invisible and then try your click.

Comments

0

Sometimes using Xpath is easier Try: driver.find_element_by_xpath(Xpath).click()

where Xpath should point to the object which you are planning to click

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.