0.1.4 • Published 5 years ago

grabbi v0.1.4

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

grabbi Build Status

 simple web scraper/crawler

grabbi using JSDOM and axios under hood provide simple but powerful way for scraping websites.

Install grabbi

npm i grabbi

Usage

const grabbi = require('grabbi')

grabbi('https://www.github.com').then(({ doc, res }) => {
  console.log(doc.title)
  console.log(doc.getElementsByClassName('alt-lead mb-4')[0].textContent)
}).catch(err => console.log(err))

Custom config

const grabbi = require('grabbi')

// you can use https://github.com/axios/axios#axios-api as config
const config = {
  method: 'get',
  timeout: 10000,
  headers: { 'X-Custom-Header': 'foobar' }
}

grabbi('https://en.wikipedia.org/wiki/Main_Page', config).then(({ doc, res }) => {
  console.log(doc.title)
  console.log(doc.querySelector('div[id="articlecount"]').textContent)
}).catch(err => console.log(err))
0.1.4

5 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.10

6 years ago