lewisakura / spiderboi

A web crawling library written in TypeScript.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Spiderboi

NPM

A web crawling library written in TypeScript.

Example

import Crawler from 'spiderboi';

async function run() {
    const crawler = new Crawler('https://google.com');

    // this gets the site's robots.txt so that the crawler can respect it
    await crawler.readyUp();

    const out = await crawler.crawl('/search/about');
    console.log(out);
}

run();
/**
 * above code should output:
 * [ 'https://google.com/search/about/',
 * 'https://google.com/search/about/',
 * 'https://google.com/#app-store',
 * 'https://google.com/#app-store',
 * 'https://google.com/#image-texts' ]
 * 
 * unless of course google changes the /search/about page and ruins this example.
 */

About

A web crawling library written in TypeScript.


Languages

Language:TypeScript 100.0%