Skip to content

FantoX/search-it

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The simplest yet most powerful web search scraper



Description:

  • A scraper that searches the web and returns structured results including the page title, URL, and description.
  • Supports both ES5 and ES6 JavaScript, plus TypeScript.
  • Zero external runtime dependencies — built with Node's native https module and Cheerio.
  • Scraping a website is not always allowed by the website owners. This project is made for educational purposes only.

Installation:

npm i @fantox01/search-it
yarn add @fantox01/search-it

Usage:

  • For ES5 Javascript
const { searchit } = require("@fantox01/search-it");

const main = async () => {
  const data = await searchit("cloudflare", 5);
  console.log(data);
};
main();

  • For ES6 Javascript / Typescript
import { searchit } from "@fantox01/search-it";

const main = async () => {
  const data = await searchit("cloudflare", 5);
  console.log(data);
};
main();

Output:

  • Returns an array of result objects, each with index, page, url, and desc.
[
  {
    index: 0,
    page: 'Connect, protect, and build everywhere | Cloudflare',
    url: 'https://www.cloudflare.com/',
    desc: 'Agents are the future of AI, and Cloudflare is the best place to get started...'
  },
  {
    index: 1,
    page: 'Cloudflare - Wikipedia',
    url: 'https://en.wikipedia.org/wiki/Cloudflare',
    desc: 'Cloudflare, Inc. is an American technology company...'
  },
  ...
]

Making of @fantox01/search-it

How?

  • Using Cheerio and Node's built-in https module
  • Cheerio - A fast, flexible, and elegant library for parsing and manipulating HTML and XML.

Why?

  • IDK, scraping is fun to me and also legal up to a limited extend as long as you don't misuse it.

Contributions

  • Made by FantoX
  • I don't have any other contributors in this project yet. Feel free to contribute.

Support me

  • Give this project a 🌟 if you like my project.
  • Please follow me on GitHub to get notified about my upcoming projects.

About

A simple yahoo search scraper

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors