google-play-scraper
Advanced tools
Comparing version 6.2.0 to 6.2.1
@@ -156,3 +156,3 @@ 'use strict'; | ||
comments: { | ||
path: ['ds:14', 0], | ||
path: ['ds:15', 0], | ||
fun: extractComments | ||
@@ -159,0 +159,0 @@ } |
@@ -21,2 +21,3 @@ 'use strict'; | ||
request(options, opts.throttle) | ||
.then(cheerio.load) | ||
.then(extractCategories) | ||
@@ -28,25 +29,8 @@ .then(resolve) | ||
function extractCategories (body) { | ||
const $ = cheerio.load(body); | ||
const childLinks = $('.child-submenu-link') | ||
.map((i, el) => $(el).attr('href')) | ||
.get(); | ||
const parentLinks = $('.parent-submenu-link') | ||
.map((i, el) => $(el).attr('href')) | ||
.get(); | ||
const everyLink = parentLinks.concat(childLinks); | ||
const categoryIds = []; | ||
for (let link of everyLink) { | ||
if (!link.startsWith(CATEGORY_URL_PREFIX)) { | ||
continue; | ||
} | ||
if (link.includes('?age=')) { | ||
continue; | ||
} | ||
categoryIds.push(link.substr(CATEGORY_URL_PREFIX.length)); | ||
} | ||
function extractCategories ($) { | ||
const categoryIds = $('a') | ||
.toArray() | ||
.map((el) => $(el).attr('href')) | ||
.filter((url) => url.startsWith(CATEGORY_URL_PREFIX) && !url.includes('?age=')) | ||
.map((url) => url.substr(CATEGORY_URL_PREFIX.length)); | ||
categoryIds.push('APPLICATION'); | ||
@@ -53,0 +37,0 @@ |
{ | ||
"name": "google-play-scraper", | ||
"version": "6.2.0", | ||
"version": "6.2.1", | ||
"description": "scrapes app data from google play store", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
66674
1357