How to parse JSON

Script File :

scrapeableFile.setContentType("application/json; charset=utf-8");
           ub=session.getVariable("ID");
           scrapeableFile.setRequestEntity("{\"UB\":"+ub+"}");

LAST RESPONSE :

</head>
<body>
{"d":"\u003cdiv class=\"CorpName\"\u003e HOLDINGS PUBLIC\u003c/div\u003e\u003ctable\u003e\u003ctr\u003e\u003ctd class=\"CorpLabel\"\u003eNumber\u003c/td\u003e\u003ctd\u003e6032019\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"CorpLabel\"\u003eCategory\u003c/td\u003e\u003ctd\u003eLLC\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"CorpLabel\"\u003eActive/Inactive\u003c/td\u003e\u003ctd\u003eActive\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"CorpLabel\"\u003eState of Incorporation\u003c/td\u003e\u003ctd\u003eWA\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"CorpLabel\"\u003eWA Filing Date\u003c/td\u003e\u003ctd\u003e04/23/2012\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"CorpLabel\"\u003eExpiration Date\u003c/td\u003e\u003ctd\u003e04/30/2013\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"CorpLabel\"\u003eInactive Date\u003c/td\u003e\u003ctd\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"CorpLabel\"\u003eDuration\u003c/td\u003e\u003ctd\u003ePerpetual\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd colspan=\"2\" class=\"CorpSep\"\u003eRegistered Agent Information\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"CorpLabel\"\u003eAgent Name\u003c/td\u003e\u003ctd\u003eKINNE F HAWES\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"CorpLabel\"\u003eAddress\u003c/td\u003e\u003ctd\u003e600 UNIVERSITY ST\u003cbr /\u003eSTE 2424\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"CorpLabel\"\u003eCity\u003c/td\u003e\u003ctd\u003eSEATTLE\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"CorpLabel\"\u003eState\u003c/td\u003e\u003ctd\u003eWA\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"CorpLabel\"\u003eZIP\u003c/td\u003e\u003ctd\u003e98101 \u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd colspan=\"2\" class=\"CorpSep\"\u003eSpecial Address Information\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"CorpLabel\"\u003eAddress\u003c/td\u003e\u003ctd\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"CorpLabel\"\u003eCity\u003c/td\u003e\u003ctd\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"CorpLabel\"\u003eState\u003ctd\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class=\"CorpLabel\"\u003eZip\u003ctd\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\u003cbr /\u003e\u003ca href=\"search_detail.aspx?ubi=603201931\"\u003eView Additional Information &raquo;\u003c/a\u003e\u003cbr /\u003e\u003cbr /\u003e\u003ca href=\"OrderDocs.aspx?ubi=603201931\"\u003ePurchase Documents for this Corporation &raquo;\u003c/a\u003e\u003cdiv style=\"text-align:center;margin-top:15px;\"\u003e\u003ca href=\"javascript:closeDetail();\"\u003e&raquo; Close &laquo;\u003c/div\u003e"}
</body>
</html>

After replacing \u003c to < , \u003e to >

{"d":"<div class=\"CorpName\"> HOLDINGS PUBLIC</div>
<table>
<tr>
<td class=\"CorpLabel\">Number</td>
<td>6032019</td>
</tr>
<tr>
<td class=\"CorpLabel\">Category</td>
<td>LLC</td>
</tr>
<tr><td class=\"CorpLabel\">
Active/Inactive</td><td>Active</td></tr><tr><td class=\"CorpLabel\">State of Incorporation</td><td>WA</td></tr><tr><td class=\"CorpLabel\">WA Filing Date</td><td>04/23/2012</td></tr><tr><td class=\"CorpLabel\">Expiration Date</td><td>04/30/2013</td></tr><tr><td class=\"CorpLabel\">Inactive Date</td><td></td></tr><tr><td class=\"CorpLabel\">Duration</td><td>Perpetual</td></tr><tr><td colspan=\"2\" class=\"CorpSep\">Registered Agent Information</td></tr><tr><td class=\"CorpLabel\">Agent Name</td><td>KINNE F HAWES</td></tr><tr><td class=\"CorpLabel\">Address</td><td>600 UNIVERSITY ST<br />STE 2424</td></tr><tr><td class=\"CorpLabel\">City</td><td>SEATTLE</td></tr><tr><td class=\"CorpLabel\">State</td><td>WA</td></tr><tr><td class=\"CorpLabel\">ZIP</td><td>98101 </td></tr><tr><td colspan=\"2\" class=\"CorpSep\">Special Address Information</td></tr><tr><td class=\"CorpLabel\">Address</td><td></td></tr><tr><td class=\"CorpLabel\">City</td><td></td></tr><tr><td class=\"CorpLabel\">State<td></td></tr><tr><td class=\"CorpLabel\">Zip<td></td></tr></table><br /><a href=\"search_detail.aspx?ubi=603201931\">View Additional Information &raquo;</a><br /><br /><a href=\"OrderDocs.aspx?ubi=603201931\">Purchase Documents for this Corporation &raquo;</a><div style=\"text-align:center;margin-top:15px;\"><a href=\"javascript:closeDetail();\">&raquo; Close &laquo;</div>"}

I want to Extract :
Number => 6032019
Category =>LLC
Agent Name => KINNE F HAWES
and so on..

Please help me .

You could make a script that

You could make a script that takes scrapeableFile.getContentAsString, and have it replace the characters, and run it "before extractor pattern is applied" and it will make the page readable for you to make regular extractors with.

Thanks

Thanks Json..Its working fine...
my script:

String fixString(value)
{
 value = value.replaceAll("\\\\u003c", "<");
 value = value.replaceAll("\\\\u003e", ">");
 value = value.replaceAll("\\\\u0027", "'");
 
 return value;
}
 
String string = scrapeableFile.getContentAsString();
 
string=fixString(string);
session.log( "************TESTING :: "+string+" ***********************" );