Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xinix-technology/luwak
https://github.com/xinix-technology/luwak
Last synced: about 12 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/xinix-technology/luwak
- Owner: xinix-technology
- Created: 2015-10-08T11:29:11.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2023-03-05T22:07:44.000Z (over 1 year ago)
- Last Synced: 2024-08-11T09:19:44.862Z (3 months ago)
- Language: JavaScript
- Size: 355 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-xinix - luwak - Node.JS based scrapper engine - [reekoheek](https://github.com/reekoheek) (Grouping / Node)
README
# 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,
```sh
npm i luwak
```Then write the code,
```js
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();
}})();
```