npm.io
1.2.0 • Published 4 years ago

body-snatchers

Licence
MIT
Version
1.2.0
Deps
3
Size
12 kB
Vulns
0
Weekly
0
Stars
1

Get the HTML text bodies from web pages

Get a single body

const { getBody } = require('body-snatchers')

const bodyString = await getBody('https://news.ycombinator.com/', false)

Multiple bodies

const { getBodies } = require('body-snatchers')

const bodyStrings = await getBodies([
  { url: 'https://news.ycombinator.com/' },
  { url: 'https://google.com/', js: true } // page that requires JavaScript
])

Motivation

  • Ease burden on CPU (requests pages one at a time)
  • Work on Raspberry Pi (tested on 2, 3, 4*)