Socket
Socket
Sign inDemoInstall

google-sr

Package Overview
Dependencies
16
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    google-sr

Yet another library to do google searches, easy and simple


Version published
Weekly downloads
90
decreased by-68.31%
Maintainers
1
Install size
2.92 MB
Created
Weekly downloads
 

Readme

Source

Google-sr

Yet another library to do google searches.

Below is a simple example of using this package

Install

npm install google-sr
  • Typescript and Javascript compatible

Usage

with .then
Without safe mode
import search from 'google-sr'

search('node.js', { safeMode: false }).then(r => console.log(r))
With safe mode
import search from 'google-sr'

search('node.js').then(r => console.log(r))

With async/await

import search from 'google-sr'

// use an iife to use await
(async () => {
  const result = await search('node.js')
  console.log(result)
  // search('node.js', { safeMode: false }) for without safe mode
})()

Available options

  • Page - default:- 1
  • Selectors - { DescriptionSelector, linkSelector, TitleSelector } - default: DefaultSelectors
  • safeMode - default :- true

selectors default -

  • DescriptionSelector - #main > div > div > div > div:not(.v9i61e) > div.AP7Wnd
  • linkSelector - div.ZINbbc > div:nth-child(1) > a
  • TitleSelector - div.ZINbbc > div:nth-child(1) > a > h3

Support

Join my discord server for support: discord

License

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

Keywords

FAQs

Last updated on 26 Feb 2022

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