Closed Pnlvfx closed 10 months ago
if (Array.isArray(searchQuery)) { const promises = searchQuery.map(async (query) => { const images = await this._scrapePage(query, limit); return { query, images }; }); results = await Promise.all(promises); } else { results = await this._scrapePage(searchQuery, limit); }
await this._scrapePage(searchQuery, limit);
_scrapePage
Seems like it! Thanks for the catch, this makes things faster.
if (Array.isArray(searchQuery)) { const promises = searchQuery.map(async (query) => { const images = await this._scrapePage(query, limit); return { query, images }; }); results = await Promise.all(promises); } else { results = await this._scrapePage(searchQuery, limit); }