-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Need to get reviews from google play for apps. Here is a basic code snippet. I worked.
var request = require('request');
var cheerio = require('cheerio');
// Set the headers
var headers = { 'User-Agent': 'Wild/0.0.1'
, 'Content-Type': 'application/x-www-form-urlencoded'
}
// Configure the request
var options = { url: 'https://play.google.com/store/getreviews'
, method: 'POST'
, headers: headers
, form: { 'reviewType': 0
, 'pageNum': 1
, 'id': 'com.github.mobile'
, 'reviewSortOrder': 2
}
}
// Start the request
request(options, function (error, response, body) {
if (!error && response.statusCode == 200) {
var htmlString = JSON.parse(body.slice(7, -1))[2];
var reviews = [];
$ = cheerio.load(htmlString);
$('.single-review').each(function(i, elem) {
reviews[i] = $(this).text();
});
console.log(reviews[0]);
}
})Metadata
Metadata
Assignees
Labels
No labels