0.1.0 • Published 4 years ago

ven0m v0.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

Venom

Getting Started

Installation

npm i venom
# or "yarn add venom"

Usage

1. Define a class

const Venom = require('venom');

class Example extends Venom {
  urls = [
    'https://example.com',
  ]

  parse() {
    const title = this.$('h1')
    console.log(title)
  }

  join_urls() {
    return this.$('a').attr('href')
  }
}

2. Start

const puppeteer = require('puppeteer')

(async () => {
  const broser = await puppeteer.launch()
  const example = new Example()
  await example.start(broser)
})()