On my second day of learning Selenium, I am looking to extract text from within specific HTML tags.
Here is a sample of the HTML code:
<div id="media-buttons" class="hide-if-no-js"/>
<textarea id="DescpRaw" class="ckeditor" name="DescpRaw" rows="13" cols="100" style="visibility: hidden; display: none;">
Cactus spines are produced from specialized structures
called areoles, a kind of highly reduced branch. Areoles
are an identifying feature of cacti.
</textarea>
Desired output:
Cactus spines are produced from specialized structures
called areoles, a kind of highly reduced branch. Areoles
are an identifying feature of cacti.
I attempted using Selenium driver below, but it returned empty results.
String bodyhtml = driver.findElement(By.xpath("//textarea[@name='DescpRaw']")).getText();
Appreciate your help!