Skip to content
Advertisement

Unable to locate button in selenium

I am trying to get an element from a website and I would get this error:

JavaScript

I got the element by copying the XPath in inspect element and made sure the element exists and is clickable. Here is my code:

JavaScript

Here is the HTML code:

JavaScript

How can I fix this?

Advertisement

Answer

It may be easier to test if you include the URL you’re working with.

You can try finding it by text instead:

JavaScript

Click button by text using Python and Selenium

This may also help. It’ll record your clicks and may give you the right path you need.

https://chrome.google.com/webstore/detail/katalon-recorder-selenium/ljdobmomdgdljniojadhoplhkpialdid?hl=en-US

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement