@fantox01/search-it
v1.0.0
Published
The simplest yet most powerful web search scraper
Maintainers
Readme
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
httpsmodule 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-ityarn add @fantox01/search-itUsage:
- 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, anddesc.
[
{
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
httpsmodule - 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.
