I am trying to extract the text "2000" and store this in a string from below HTML:
<table class="table" _ngcontent-c13="">
<tbody _ngcontent-c13="">
<tr _ngcontent-c13="">
<th _ngcontent-c13="" scope="row">Amount</th>
<td class="" _ngcontent-c13="">
<b _ngcontent-c13="">$2000</b>
</td> <!-- Added by edit -->
</tr> <!-- Added by edit -->
</tbody> <!-- Added by edit -->
</table> <!-- Added by edit -->
I am trying below XPath, but it's returning null
:
String text= driver.findelement(by.xpath("xpath="//table[@class='table']/tbody/tr[1]/td")).getAttribute("value")