OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

How to get text of an HTML-Element with Selenium/Node.js

  • Thread starter Thread starter Tonisal
  • Start date Start date
T

Tonisal

Guest
Unfortunately I did not find any existing solution for my problem on stackoverflow. So, can someone help.

I want to get the text of an html-element. I tried this:

Code:
var element = driver.findElement(webdriver.By.className("credits")).getText();

console.log(element);

Unfortunately this did not work so far.

<p>Unfortunately I did not find any existing solution for my problem on stackoverflow. So, can someone help.</p>

<p>I want to get the text of an html-element. I tried this:</p>

<pre><code>var element = driver.findElement(webdriver.By.className("credits")).getText();

console.log(element);
</code></pre>

<p>Unfortunately this did not work so far. </p>
 
Top