mastercho 3 Posted June 1, 2018 Report Share Posted June 1, 2018 (edited) Hi all I'm trying to parse big json response from API but plugins as JSON Path and JSON Get Value from ExBrowser fails to parse it: Here is JSON https://ghostbin.com/paste/d5kjx please have a look and this is part of code scraping. define setup excel { set(#row,0,"Global") set table cell(&results,#row,0,"Name") set table cell(&results,#row,1,"companyId") set table cell(&results,#row,2,"Industry") set table cell(&results,#row,3,"Size") set table cell(&results,#row,4,"Location") set table cell(&results,#row,5,"Keyword") } define scrape to excel { set(#row,1,"Global") load html($plugin function("ExBrowser.dll", "$ExBrowser Document Text")) wait(1) set table cell(&results,#row,0,$plugin function("JSONpath.dll", "$JSONpath parser", $plugin function("ExBrowser.dll", "$ExBrowser Document Text"), "searchResults[*].name")) wait(1) increment(#row) } Edited June 4, 2018 by mastercho Quote Link to post Share on other sites
Marani 80 Posted June 1, 2018 Report Share Posted June 1, 2018 I didn't see the attachment but try these: $.searchResults[*].name or$..searchResults[*].name Quote Link to post Share on other sites
mastercho 3 Posted June 4, 2018 Author Report Share Posted June 4, 2018 I didn't see the attachment but try these: $.searchResults[*].nameor$..searchResults[*].name Tried both, still getting an error. I added link with json on it please check thread Quote Link to post Share on other sites
Marani 80 Posted June 4, 2018 Report Share Posted June 4, 2018 All the three works: $.searchResults.[name] $.searchResults[*].name $.searchResults..name Test here:http://jsonpath.com Returns : "Technology & Science Dynamics / TSD", "Technology Innovations Group LLC", "Technology Marketing Toolkit, Inc.", "Technology Solutions Group, Inc.", "Technology Services Group - Chicago", "Technology Resource Services, Inc.", "Technology Plus Inc.", "Technology & Business Solutions, LLC", "Technology Foundation of the Americas", "Technology Business Solutions", "Technology Seed", "Technology Solutions", . . . Quote Link to post Share on other sites
mastercho 3 Posted June 4, 2018 Author Report Share Posted June 4, 2018 All the three works: $.searchResults.[name] $.searchResults[*].name $.searchResults..name Test here:http://jsonpath.com Returns : "Technology & Science Dynamics / TSD", "Technology Innovations Group LLC", "Technology Marketing Toolkit, Inc.", "Technology Solutions Group, Inc.", "Technology Services Group - Chicago", "Technology Resource Services, Inc.", "Technology Plus Inc.", "Technology & Business Solutions, LLC", "Technology Foundation of the Americas", "Technology Business Solutions", "Technology Seed", "Technology Solutions", . . . Well yes if make a read from file then this works but as you see in the photo its from document text maybe that's where i wrong. Trying to get body with //body/* xpath into variable but seems fails also hmm looking for more alternatives Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted June 4, 2018 Report Share Posted June 4, 2018 Set the Json area to a variable first, then call it in the Json parser test.ubot Quote Link to post Share on other sites
Marani 80 Posted June 4, 2018 Report Share Posted June 4, 2018 (edited) Seems it is solved? Edited June 4, 2018 by Marani Quote Link to post Share on other sites
mastercho 3 Posted June 4, 2018 Author Report Share Posted June 4, 2018 The issue was starting at FF because new versions of FF have JSON parser and brokes raw JSON format. Changed to Chrome, tried to get JSON part with XPath was still failing saying too big data to scrape. and I have to scrape it with Regex and then after getting JSON part from DOM with REGEX i was able to use JSON Value parse . BTW tried TJ solution but was not happy to put json variable as a parameter and i did without Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.