google-play/node_modules/google-play-scraper/lib/search.js
/*
 * Make the first search request as in the browser and call `checkfinished` to
 * process the next pages.
 */
Make the first search request as in the browser and call `checkfinished` to
process the next pages.
Make the first search request as in the browser and call ` checkfinished ` to process the next pages .
function initialRequest (opts) {
  function skipClusterPage (html) {
    const match = html.match(/href="\/store\/apps\/collection\/search_collection_more_results_cluster?(.*?)"/);
    if (match) {
      const innerUrl = 'https://play.google.com/' + match[0].split(/"/)[1];
      return request(Object.assign({
        url: innerUrl
      }, opts.requestOptions), opts.throttle);
    }
    return html;
  }
  const url = `https://play.google.com/store/search?c=apps&q=${opts.term}&hl=${opts.lang}&gl=${opts.country}&price=${opts.price}`;
  return request(Object.assign({url}, opts.requestOptions), opts.throttle)
      .then(skipClusterPage)
      .then((html) => processAndRecur(html, opts, [], INITIAL_MAPPINGS));
}
function initialRequest ( opts ) { function skipClusterPage ( html ) { const match = html . match ( / href="\/store\/apps\/collection\/search_collection_more_results_cluster?(.*?)" / ) ; if ( match ) { const innerUrl = 'https://play.google.com/' + match [ 0 ] . split ( / " / ) [ 1 ] ; return request ( Object . assign ( { url : innerUrl } , opts . requestOptions ) , opts . throttle ) ; } return html ; } const url = ` ${ opts . term } ${ opts . lang } ${ opts . country } ${ opts . price } ` ; return request ( Object . assign ( { url } , opts . requestOptions ) , opts . throttle ) . then ( skipClusterPage ) . then ( ( html ) => processAndRecur ( html , opts , [ ] , INITIAL_MAPPINGS ) ) ; }
Make the first search request as in the browser and call `checkfinished` to
 process the next pages.
Make the first search request as in the browser and call ` checkfinished ` to process the next pages .
// sometimes the first result page is a cluster of subsections, // need to skip to the full results page