Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abdus/scrape-web
A simple web scrapper for Node.js
https://github.com/abdus/scrape-web
crawler web-scraping web-scrapper
Last synced: 22 days ago
JSON representation
A simple web scrapper for Node.js
- Host: GitHub
- URL: https://github.com/abdus/scrape-web
- Owner: abdus
- Created: 2019-07-07T07:02:46.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-09T17:18:04.000Z (almost 2 years ago)
- Last Synced: 2023-03-03T02:48:24.880Z (over 1 year ago)
- Topics: crawler, web-scraping, web-scrapper
- Language: JavaScript
- Homepage:
- Size: 25.4 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Scrapper
> A plug-n-play scrapper for Node.js
I keep writing the same code again and again. So, thought of publishing it as a package.
## usage
```javascript
const scrapper = require('scrape-web');scrapper({
url: 'https://www.nytimes.com/',
elementToScrape: 'article .title',
})
.then(data => console.log(data))
.catch(err => console.log(err));
```#### With `async/await`
```javascript
const scrapper = require('scrape-web');(async () => {
try {
const result = await scrapper({
url: 'https://www.nytimes.com/',
elementToScrape: 'article .title',
});console.log(result);
} catch (err) {
console.log(err);
}
})();
```Return an array of Objects
```javascript
[
{
href: '/some/url/location.html',
textContent: `Returns null if there's no textContent`,
src: 'applicaple in tags like img',
},
];
```## License
This package is published under the terms of the [MIT License](https://license.thisisabdus.dev).