@hidori/playwright-crawler-core

0.0.5 • Public • Published

@hidori/playwright-crawler-core

Playwright crawler core

INSTALL

npm i --save @hidori/playwright-crawler-core

USAGE

import { Crawler } from "@hidori/playwright-crawler-core";

class GoogleCaptureJob {
  async run({ crawler, page }) {
    await page.goto("https://www.google.com");
    crawler.infoSync("google/capture: navigated");

    await page.screenshot({ path: "screenshot.png", fullPage: true });
    crawler.infoSync("google/capture: captured");

    await page.waitForTimeout(5000);
  }
}

const config = {
  playwright: {
    channel: "chrome",
    headless: false,
  },
};

const jobs = {
  "google/capture": new GoogleCaptureJob(),
};

new Crawler(config, jobs).run(["google/capture"]);

/@hidori/playwright-crawler-core/

    Package Sidebar

    Install

    npm i @hidori/playwright-crawler-core

    Weekly Downloads

    2

    Version

    0.0.5

    License

    MIT

    Unpacked Size

    6.37 kB

    Total Files

    11

    Last publish

    Collaborators

    • hidori