Get unlimited public & private packages + package-based permissions with npm Pro.Get started »

google-data-scraper

1.0.4 • Public • Published

Google Data Scraper

Google Data Scraper is a node based scraping tool built using puppeteer and cheerio libraries.

Currently it supports

  • Google News
  • Google Trends
  • Google Translate

Upcoming - Multipage scraping

Getting Started

npm install google-data-scraper --save

Usage

getGoogleNews

  • Accepts array of strings to search and boolean to specify whether to sort by date of not
  • Returns a promise
Promise<{
    searchPhrase: string;
    results: {
        linkText: string;
        linkHref: string;
    }[];
}[]>

getGoogleDailySearchTrends

  • Accepts a geo location string (for example, United states - 'US')
  • Returns a promise
Promise<{
    linkText: string;
    linkHref: string;
}[]>

translateStuff

Promise<{
    searchPhrase: string;
    result: string;
}[]>

Examples

const scraper = require("google-data-scraper");

scraper.getGoogleNews(["AI", "mars"])
    .then((data) => {
        console.log(JSON.stringify(data));
    })

scraper.translateStuff(['omae wa mou shindeiru', 'Nani?'],'en')
    .then((data) => {
        console.log(JSON.stringify(data));
    })

scraper.getGoogleDailySearchTrends('US')
    .then((data)=>{
        console.log(JSON.stringify(data));
    })

Built With

Authors

  • Balasubramanian - git

License

This project is licensed under the MIT License

Install

npm i google-data-scraper

DownloadsWeekly Downloads

2

Version

1.0.4

License

MIT

Unpacked Size

6.22 kB

Total Files

3

Last publish

Collaborators

  • avatar