xpath - How to select text from table cell that includes <br>? -
i have table contains rows this:
<tr class="premium"><td class="name"><div class="name">john doe</div>fancy company name<br />elmstreet 71<br />454378 ghostown<br />tel.: 123 4567 891<br /></td></tr> <tr class="basic"><td class="name"><div class="name">john smoe</div>fancy company name<br />elmstreet 73<br />456378 ghostown<br />tel.: 123 4567 891<br /></td></tr>
i need xpath select company name rows class="premium"
thanks in advance!
xpath returns set of strings divided <br>
tags. can use string() function take 1st past
string(//tr[@class="premium"]/td[@class = "name"]/text())
or kjhughes has supposed
//tr[@class="premium"]/td[@class = "name"]/text()[1]
result
string='fancy company name'
Comments
Post a Comment