Automation Anywhere没有默认的JSON解析工具。然而,它确实附带了一个DLL库,可以用来将JSON转换为XML,AA可以很好地处理XML文档。
在Automation Anywhere中,如何解析响应REST API调用的json字符串?与UiPath不同,AA似乎没有JSON字符串的反序列化选项。
我的目的是从"searchResult"元素中提取"item"的详细信息。请帮忙。
下面是我的json字符串:
[{"findItemsByKeywordsResponse":[{"ack":["Success"],"version":["1.13.0"],"timestamp":["2018-08-06T19:30:50.830Z"],"searchResult":[{"@count":"2","item":[{"itemId":["253482447437"],"title":["*Sealed in Box* Verizon Apple iPhone SE 16/64GB 4.0" Unlocked Smartphone"],"globalId":["EBAY-US"],"subtitle":["NO-RUSH 14 DAYS SHIPPING ONLY! US LOCATION!"],"primaryCategory":[{"categoryId":["9355"],"categoryName":["Cell Phones & Smartphones"]}],"galleryURL":["http://thumbs2.ebaystatic.com/pict/253482447437404000000004_1.jpg"],"viewItemURL":["http://www.ebay.com/itm/Sealed-Box-Verizon-Apple-iPhone-SE-16-64GB-4-0-Unlocked-Smartphone-/253482447437?var=552665991559"],"paymentMethod":["PayPal"],"autoPay":["false"],"postalCode":["10002"],"location":["New York,NY,USA"],"country":["US"],"shippingInfo":[{"shippingServiceCost":[{"@currencyId":"USD","__value__":"0.0"}],"shippingType":["Free"],"shipToLocations":["Worldwide"],"expeditedShipping":["false"],"oneDayShippingAvailable":["false"],"handlingTime":["3"]}],"sellingStatus":[{"currentPrice":[{"@currencyId":"USD","__value__":"260.99"}],"convertedCurrentPrice":[{"@currencyId":"USD","__value__":"260.99"}],"sellingState":["Active"],"timeLeft":["P1DT14H31M1S"]}],"listingInfo":[{"bestOfferEnabled":["false"],"buyItNowAvailable":["false"],"startTime":["2018-03-11T10:01:51.000Z"],"endTime":["2018-08-08T10:01:51.000Z"],"listingType":["StoreInventory"],"gift":["false"],"watchCount":["104"]}],"returnsAccepted":["true"],"condition":[{"conditionId":["1000"],"conditionDisplayName":["New"]}],"isMultiVariationListing":["true"],"topRatedListing":["false"]},{"itemId":["401421457135"],"title":["Apple iPhone 7 "Factory Unlocked" 32GB 4G LTE iOS WiFi Smartphone"],"globalId":["EBAY-US"],"subtitle":["USA Seller - No Contract Required - Fast Shipping!!"],"primaryCategory":[{"categoryId":["9355"],"categoryName":["Cell Phones & Smartphones"]}],"galleryURL":["http://thumbs1.ebaystatic.com/pict/04040_0.jpg"],"viewItemURL":["http://www.ebay.com/itm/Apple-iPhone-7-Factory-Unlocked-32GB-4G-LTE-iOS-WiFi-Smartphone-/401421457135?var=0"],"paymentMethod":["PayPal"],"autoPay":["true"],"postalCode":["07014"],"location":["Clifton,NJ,USA"],"country":["US"],"shippingInfo":[{"shippingServiceCost":[{"@currencyId":"USD","__value__":"0.0"}],"shippingType":["Free"],"shipToLocations":["Worldwide"],"expeditedShipping":["true"],"oneDayShippingAvailable":["false"],"handlingTime":["1"]}],"sellingStatus":[{"currentPrice":[{"@currencyId":"USD","__value__":"319.95"}],"convertedCurrentPrice":[{"@currencyId":"USD","__value__":"319.95"}],"sellingState":["Active"],"timeLeft":["P29DT23H2M23S"]}],"listingInfo":[{"bestOfferEnabled":["false"],"buyItNowAvailable":["false"],"startTime":["2017-10-10T18:33:13.000Z"],"endTime":["2018-09-05T18:33:13.000Z"],"listingType":["StoreInventory"],"gift":["false"],"watchCount":["9152"]}],"returnsAccepted":["true"],"condition":[{"conditionId":["2500"],"conditionDisplayName":["Seller refurbished"]}],"isMultiVariationListing":["true"],"topRatedListing":["true"]}]}],"paginationOutput":[{"pageNumber":["1"],"entriesPerPage":["6"],"totalPages":["2779640"],"totalEntries":["16677839"]}],"itemSearchURL":["http://www.ebay.com/sch/i.html?_nkw=iPhone&_ddo=1&_ipg=6&_pgn=1"]}]}][1]
有问题的图书馆是Newtonsoft。Json.dll(您可以在AA客户端安装目录中找到它(,它有几种处理Json的有用方法(请参阅此处(