-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
The callback is called for each response.
To answer my own question,
const searchGoogle = (query: string, limit: number = 10) => {
return new Promise((resolve, reject) => {
const results = [];
GoogleSearchScraper.search({
host: 'www.google.com',
lang: 'en',
limit,
query: query + ' site:imdb.com/title/'
}, (error, result) => {
if (error) {
reject(error);
} else {
results.push(result);
if (limit === results.length) {
resolve(results);
}
}
});
});
};However, this will hang if there are no results for the query.
Am I overlooking something?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels