My requirement is to scrap all the review data like reviewer name, date and comment in array. That i am doing in mulesoft in groovy script by importing Jsoup.
Using below query i am able to fetch the review data but it’s coming in a single string. Not sure how to separate the div tag here.
Please inspect the mentioned url and please suggest how i can run a loop on <div class=”Jwxk6d” and make the expected output.
code:
import org.jsoup.Jsoup
def url= "https://play.google.com/store/apps/details?id=at.bitfire.davdroid&hl=en_IN"
def doc= Jsoup.connect(url).get()
def appReviewData= doc.select("div[class='EGFGHd']").text()
return [ReviewData: appReviewData]
expected output:
{
"ReviewData": [{
"name": "Ben Perkins",
"reviewDate": "7 June 2024",
"reviewComment": "xyz"
}]
}