We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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?
The text was updated successfully, but these errors were encountered:
You're right, another callback should be fired when there are no more results. I'll accept PRs fixing this as long as they are backwards-compatible.
Sorry, something went wrong.
No branches or pull requests
The callback is called for each response.
To answer my own question,
However, this will hang if there are no results for the query.
Am I overlooking something?
The text was updated successfully, but these errors were encountered: