Search code examples
xpathline-breaks

Xpath Reading multiple br line as one line


how to read line separated by br as one line, heres the html

<html>
	<head></head>
	<body>
	<table>
	<tbody>
	<tr>
	<td class="clas101"> 
		<nobr>Crude Degummed</nobr>
		<br>
		<nobr>Soybean Oil-Crude</nobr>
		<br>
		<nobr>Degummed Soybean</nobr>
		<br>
		<nobr>Oil</nobr>
	</td>
	</tr>
	</tbody>
	</table>
	</body>
</html>

i want to read it as one line something like this:

//td[class='clas101']/nobr[combineText()='Crude Degummed Soybean Oil-Degummed Soybean Oil']

Solution

  • You can try :

    //td[@class="clas101"][normalize-space()="Crude Degummed Soybean Oil-Crude Degummed Soybean Oil"]/nobr