Skip to content

Repository files navigation

krabber

Easy to use webscraper using Axios and JSDOM.

Codecov branchGitlab pipeline status (branch)Libraries.io dependency status for latest releasenpm

Example

import{Scrape}from'krabber';constscrapeConfig={url: 'https://github.com/axios/axios',options: {headers: {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:64.0) Gecko/20100101 Firefox/64.0'}},select: {numberOfCommits: ({ dom, res, prev, url })=>{returndom.querySelector('.commits span.text-emphasized.num').innerHTML.trim();}}}Scrape(scrapeConfig).then((res)=>{console.log(res.numberOfCommits);})

More examples, including pagination handling

Please see the test suite in src/lib/scrape.spec.ts

About

Easy web scraping with AXIOS and JSDOM - this is a mirror of https://gitlab.com/ledgit/krabber

Topics

Resources

Contributing

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages