I am trying to extract text that are not nested within an HTML element. Here is the HTML
<div class="col-sm-12">
<i class='fa fa-map-marker'></i>theCity
<i class='fa fa-link'></i>theEmail
<i class='fa fa-phone'></i>thePhone1
<i class='fa fa-phone'></i>thePhone2
<b>Fax:</b>theFax
<b>Address:</b>theAddress
</div>
I wanted to get the following results
- theCity
- theEmail
- thePhone1
- thePhone2
- theFax
- theAddress
As you can see there have different formats. theCity, theEmail, thePhone1 and thePhone2 have similar formats while theFax and theAddress have another one. I tried getting both types of data using the following statements, but it didn't work.
Here is the code I tried for the fax and address
//b/following-sibling::text()[1]
Here is the code for the the city, email and phone data types
normalize-space(//div[@class="fa-map-marker"]/following-sibling::text())
What am I doing wrong?