Skip to content

andraindrops/yomuco

Repository files navigation

Yomuco

Yomuco – A simple web crawling library for Node.js

Setup

bun add yomuco

Getting Started

import { getBrowser, getUrls, getContent } from "yomuco";

Set up a browser instance using Playwright

const browser = await getBrowser();

browser.close();

Retrieve URLs from a page

const browser = await getBrowser();

const urls = await getUrls({
  context: await browser.newContext(),
  fromUrl: "https://react.dev",
  maxDepth: 1,
});

browser.close();

Fetch a page content

const browser = await getBrowser();

for (const url of urls) {
  const content = await getContent({
    context: await browser.newContext(),
    url,
    selector: "main",
  });
}

browser.close();

Format

bunx @biomejs/biome format --write .

Lint

bunx @biomejs/biome lint --apply .

Test

bun test

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published