Socket
Socket
Sign inDemoInstall

google-sr

Package Overview
Dependencies
24
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    google-sr

Fast and efficient Package for scraping Google search results without the need for an API key


Version published
Maintainers
1
Created

Readme

Source

google-sr 🔍

testing workflow npm GitHub issues NPM npm version CodeFactor

Simple & Fast Package for scraping Google search results without the need for an API key. 🚀

View documentation here

Features ✨

  • Lightweight 💨
  • Simple & Fast ⚡️ *
  • Well tested 🔄
  • TypeScript compatible 🧑‍💻

* depends on amount of pages fetched and host internet speed (avg of 500ms per page in testing )

Install 📦

To get started, you can install google-sr using your preferred package manager:


# npm

npm install google-sr

# pnpm 

pnpm add google-sr

# yarn

yarn add google-sr

Usage

Simple example

You can easily perform a single-page search like this:

import { search } from 'google-sr';

search({ query: 'nodejs' }).then(console.log);

// or if using await/async
const searchResults = await search({ query: 'nodejs' });
console.log(searchResults);

More detailed examples & usage can be found here

Important Notes 🚨

  • google-sr scrapes the HTML of Google search results. This means it relies on Google's predefined HTML structure. If Google changes this structure, the package might seem to behave unexpectedly. To avoid this, it's best to keep your package updated to the latest version. (Note: we may take time to update it to any new structure)

View current selectors here

  • Fetching multiple pages can be slow, we recommended either fetching only small amount (i.e 5 max) or fetching pages in chunks as needed using specific page control of searchWithPages function

Tests

Tests are written using mocha and can be run by using the test script


# npm

npm run test

# pnpm 

pnpm run test

# yarn

yarn run test

Support & Bug Reporting 🛠️🐞

Make sure you are on the latest version before creating bug reports

Support and bug reporting both can be done on either my discord server or on github issues

License

This repository and the code inside it is licensed under the Apache-2.0 License. Read LICENSE for more information.

Keywords

FAQs

Last updated on 11 Aug 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc