Skip to content

xinix-technology/luwak

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Luwak

Luwak (mongoose) is animal that eat coffee beans and poop beans out as best coffee in the world.

The philosophy is vast internet data already rich in web pages kind, somehow for our application we need clean data. With luwak we can extract and scrape data from web pages.

How to use

Install using npm,

npm i luwak

Then write the code,

const { Scraper, release, source } = require('luwak');

(async () => {
    const scraper = new Scraper('http://example.net/some-list.html');

    try {
        const result = scraper.fetch([{
            '$root': '.pd',
            'title': '.m > a',
            'url': '.m > a@href',
            'websiteTitle': source('.m > a@href', 'title'),
        }])

        console.info(result);
    } catch (err) {
        console.error(err.stack)
    } finally {
        await scraper.close();
        await release();
    }

})();

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published