What I'm trying to do:
Get user input for Google Play App page.
e.g. https://play.google.com/store/apps/details?id=jp.scn.android
Scrape 100 reviews from Google Play App and organize them into an array.
My JavaScript function:
function test() {
var urlAdd = document.getElementById('input').value;
var urlEnglish = urlAdd + '&hl=en';
var query = {
url: urlEnglish,
type: 'html',
selector: '[class=review-body]',
extract: 'text'
},
request;
request = 'http://example.noodlejs.com/?q=' +
encodeURIComponent(JSON.stringify(query)) +
'&callback=?';
jQuery.getJSON(request, function (data) {
document.getElementById('output').innerHTML = '<pre>' +
JSON.stringify(data, null, 4) + '</pre>';
})
};
Problems:
This function feels bulky.
It only returns 20 results. My guess is that this has something to do with how the Google Play DOM retrieves reviews.
Questions:
How do I streamline/improve my scraper function?
How do I get 100 results or more?
Comments:
My apologies if this is a simple solution. I just started learning JavaScript piecemeal in February.