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

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -