google-data-scraper

Data scraper for scraping google's website

Usage no npm install needed!

<script type="module">
  import googleDataScraper from 'https://cdn.skypack.dev/google-data-scraper';
</script>

README

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