Is there a way to get element by XPath using JavaScript in Selenium WebDriver?

0
0

I am looking for something like:

getElementByXpath(//html[1]/body[1]/div[1]).innerHTML

I need to get the innerHTML of elements using JS (to use that in Selenium WebDriver/Java, since WebDriver can’t find it itself), but how?

I could use ID attribute, but not all elements have ID attribute.

[FIXED]

I am using jsoup to get it done in Java. That works for my needs.
Thanks for the answers. 🙂

  • You must to post comments
Showing 0 results
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Website