Welcome, Guest. Please Login.
IRobotSoft Robot
09/30/23 at 08:23:30
News: IRobotSoft is the Best Visual Web Computing Platform!
Home Help Search Login
Google
 


Pages: 1
Send Topic Print
extract data of json response (Read 3193 times)
mirshafiee
IRobotSoft Newbies
*


I Love IRobotSoft

Posts: 6
extract data of json response
03/06/15 at 02:05:48
 
hi,
I want to extract an save data from a json request like this:
 
http://map.tehran.ir/infra/maps/parcel/info?x=538632&y=3962800.5
 
I changed the registry  to get this request in Internet Explorer like Google Chrome (not download json file). Response of this request is something like this:
 
{"item": {"parcel": "39358037", "plaque": "3"}, "success": true}
 
 I want to save all of this response in a csv file, but my robot does not get response of this request. When I select the response, robot alarm me to focus on something!!. what should I do to extract data from json response??
Back to top
 
 
  IP Logged
IRobotSoft Administrator
IRobotSoft Administrator
*****


IRobotSoft, the Best
Internet Robot
System

Posts: 1609
Gender: male
Re: extract data of json response
Reply #1 - 03/06/15 at 19:52:43
 
For this, you may use UrlData() function to get the data directly, then use regular expression to extract attributes.  
 
For example, this is the script to extract parsel from json url:  
 
a = UrlData('http://map.tehran.ir/infra/maps/parcel/info?x=538632&y=3962800.5');
parcel = a ~ '"parcel": "[^"]*"'  ~  '"[^"]*"$'  ~  '[^"]*';
Back to top
 
 

The Administrator.
WWW   IP Logged
mirshafiee
IRobotSoft Newbies
*


I Love IRobotSoft

Posts: 6
Re: extract data of json response
Reply #2 - 03/08/15 at 11:43:10
 
just using pracel=urldata() works very well  Grin
Thanks agian.
Back to top
 
 
  IP Logged
Pages: 1
Send Topic Print