Support Portal

for ProcessRobot and WinAutomation

Start a new topic
Answered

How to scrape the JSON output.

Hi,


I am using CaptureFast OCR. I got the JSON output from OCR, But I am unable to scrape the data from JSON. Please guide me. 


Thanks in advance.




Best Answer

Hello Jayesh,


In order to parse the information from a JSON file, you first have to convert the JSON into a Custom Object.  You can do that with the "Convert Json To Custom Object" Action.


Then you can retrieve the text for any attribute like below:


If you want to parse the attribute title:  %JsonAsCustomObject.title%


If you want to parse the attribute body:  %JsonAsCustomObject.body


and so on. I.e., %Variable(dot)<attribute>%


Another more cumbersome way is to take the whole text and parse it using regular expressions.


I hope it proves to be helpful :) 



1 Comment

ADMIN
Answer

Hello Jayesh,


In order to parse the information from a JSON file, you first have to convert the JSON into a Custom Object.  You can do that with the "Convert Json To Custom Object" Action.


Then you can retrieve the text for any attribute like below:


If you want to parse the attribute title:  %JsonAsCustomObject.title%


If you want to parse the attribute body:  %JsonAsCustomObject.body


and so on. I.e., %Variable(dot)<attribute>%


Another more cumbersome way is to take the whole text and parse it using regular expressions.


I hope it proves to be helpful :) 



Login or Signup to post a comment