soupjs-lib

1.0.0 • Public • Published

SoupJS

version badge js-dom version badge node-fetch version badge

About

SoupJS is a JavaScript library built for simple web scraping.

Installation

To install using npm, run:

npm i soupjs-lib

Usage

Here's a basic example of using SoupJS:

const soupjs = require("soupjs-lib");
soupjs.scrape(url).then(res => {
    // Search for HTMl elements belonging to CSS selector
    let pTags = res.findAll("p");
    console.log(pTags);
    /*
        => [ Tag {
            tag: 'p',
            text: 'text',
            attrs: {'class': ['foo', 'bar', 'baz'], ...},
            htmlContent: 'some text',
            document: HTMLHtmlElement {}
        }, ...]
     */
}).catch(err => console.log(err));

For more information on using SoupJS, check out the documentation.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/jianmin-chen/soupjs. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

This library is available as open source under the terms of the MIT License.

Readme

Keywords

Package Sidebar

Install

npm i soupjs-lib

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

9.36 kB

Total Files

4

Last publish

Collaborators

  • jianmin-chen