Skip to main content

Hi,

 

I have a html content in _response_body. I am struggling to get only specific text from it. I would like to get only the text highlighted in red. 

<b>Layers: </b>
<ul>
<li>
<a href="/arcgis/rest/services/Imagery_Wayback_Ardstaw/MapServer/0">2014/02/20</a> (0)
</li>
<li>
<a href="/arcgis/rest/services/Imagery_Wayback_Ardstaw/MapServer/1">2016/12/07</a> (1)
 

How can I do it? I assume I should use XTMLFragmenter but I am struggling to get the result I want

If you want the link text this should work

You will then need to explode the created list


it works perfect for the sting above, thanks! How can I change it if there are more items that begins with a href and still select only the text in red

 

<a href="/arcgis/rest/services/Imagery_Wayback_Ardstaw/MapServer/legend?dynamicLayers=%5B%5D&">Dynamic Legend</a><br/><br/>
<a href="/arcgis/rest/services/Imagery_Wayback_Ardstaw/MapServer/layers?dynamicLayers=%5B%5D&">Dynamic All Layers</a><br/><br/>
<b>Layers: </b>
<ul>
<li>
<a href="/arcgis/rest/services/Imagery_Wayback_Ardstaw/MapServer/0">2014/02/20</a> (0)
</li>
<li>
<a href="/arcgis/rest/services/Imagery_Wayback_Ardstaw/MapServer/1">2016/12/07</a> (1)


To expand on ​@ebygomm's solution:

The values you want are in an <a> tag that is inside a <li> tag.

When you enter li alhref] under CSS Selector you will get only those values.

 


How would it look like if I would like to select only the highlighted text?

<b>Display Field:</b> objectid<br/><br/>
<b>Type: </b> Feature Layer<br/><br/>
<b>Geometry Type:</b> esriGeometryPoint<br/><br/>
<b>Description: </b> <br/><br/>
<b>Service Item Id: </b> 4c0f943fb60a4a369104f33d1ad2af4f<br/><br/>


How would it look like if I would like to select only the highlighted text?

<b>Display Field:</b> objectid<br/><br/>
<b>Type: </b> Feature Layer<br/><br/>
<b>Geometry Type:</b> esriGeometryPoint<br/><br/>
<b>Description: </b> <br/><br/>
<b>Service Item Id: </b> 4c0f943fb60a4a369104f33d1ad2af4f<br/><br/>

With that one, i’d look to use a string searcher and regex.
 

<b>Service Item Id: <\/b> (.+)<br\/><br\/>


You’ll need to enable subexpression matches
 

 


Reply