Parsing HTML data
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2019 10:30 AM
I have a response from web service in html format. I need to parse that out to extract the values. What is a good way to extract the data? Is there a way to convert html to xml and then parse the data?
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2019 10:58 AM
Hi,
Can you show sample data. Let me look into this and give you the script.
Thanks,
Ashutosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2019 06:18 PM
Here is the sample
<!DOCTYPE html>
<html lang="en-us" class="no-js not-ie">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="utf-8">
<input class="form-control col-sm-12" aria-label="Store Code" disabled="disabled" type="text" value="23456" name="name" id="user_name" /> </div>
<div class="entity-detail-form-group"> <label class="col-sm-12" for="store_description">Description</label>
<input class="form-control col-sm-12" aria-label="Store Description" disabled="disabled" type="text" value="test" name="store[description]" id="store_description" /> </div> <div class="entity-detail-form-group"> <label class="col-sm-12" for="store_loc_code">Store code</label> <input class="form-control col-sm-12" aria-label="Store Code" disabled="disabled" type="text" value="store23" name="store[office_code]" id="store_office_code" /> </div> <div class="entity-detail-form-group"> </div> <div class="entity-detail-form-group"> <label class="col-xs-6" for="store_active">Active</label>
{"text":Store1234",href:"1234","store code":"1234","description":"NewJersey store","store_office_code":"NJH","active":"true}
{"text":Store789",href:"789","store code":"789","description":"Newyork store","store_office_code":"NYS","active":"true}
I need to parse the data to get the values separately.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2019 02:09 AM
Hi,
can you give us how you are calling the endpoint?
how you are getting the response?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2019 02:08 AM
Hi,
I believe any integration should have either xml or json as response so that you can parse it
Can you share sample response received?
I suspect it would be in xml format
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader