A module to search and scrape google. This is not sponsored, supported, or affiliated with Google Inc.
This module allows you to search google by scraping the results. It does NOT use the Google Search API. PLEASE DO NOT ABUSE THIS. The intent of using this is convenience vs the cruft that exists in the Google Search API.
This is not sponsored, supported, or affiliated with Google Inc.
npm install [-g] google
This prints out the first 50 search results of the query
node.js best practices.
var google = require'google';googleresultsPerPage = 25;var nextCounter = 0;google'node.js best practices'if err console.errorerr;for var i = 0; i < linkslength; ++iconsole.loglinksititle + ' - ' + linksilink; //link.href is an alias for link.linkconsole.loglinksidescription + "\n";if nextCounter < 4nextCounter += 1;if next next;;
You can also specify the TLD of the Google search page and the language.
var google = require'google';googlelang = 'de';googletld = 'de';google'node.js best practices'…;
Specifying a proxy to be used when searching
var google = require'google';googleproxy = '';google'node.js best practices'…;
You can use the
-g flag when installing. The command line version outputs CSV data in the following format:
Usage: google [options] Options: -h, --help output usage information -V, --version output the version number -q, --query <query> Search query. -p, --pages [num] Number of pages to search. defaults to 5 -n, --results-per-page [num] Number of results per page. defaults to 100 -t, --tld [tld] TLD of Google search. defaults to com -l, --language [lang] Language of search. defaults to en
google -q "node.js best practices" -p 1 -n 10
Licensed under MIT. See
LICENSE for more details.
Copyright (c) 2012-2013 JP Richardson