1.0.14 • Published 2 years ago

@ogginger/crawler v1.0.14

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

@ogginger/crawler

This is a simple web crawler implemented in nodejs that uses puppeteer to navigate webpages looking for something.

Getting Started:

  1. Include it in your project:

    npm install @ogginger/crawler

  2. Include it in your code.
import Crawler from "@ogginger/crawler"
import * as puppeteer from "puppeteer"

async function() {
  let crawler = new Crawler();
  let { browser, page }: { browser: puppeteer.Browser, page: puppeteer.Page } = await crawler.open( crawler.browserOptions );
  let target = await crawler.crawl( page, 
    async function pagePredicate( page: puppeteer.Page ): Promise<{ found: boolean, target?: any }> {
      /*
        If you find something in the page then return { found: true, target: "what you want" }.
        Otherwise return { found: false }
      */
    },
    linkList,
    function linkPredicate( link: string, linkBlacklist: any ) {
      // If you want to eventually crawl the link then return true.
      // Otherwise return false.
    }
  );
}
1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago