This repository has been archived by the owner on Dec 30, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add readme, update code, update package.json
- Loading branch information
Showing
5 changed files
with
53 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,23 @@ | ||
WORK IN PROGRESS, PLUGIN IS NOT READY YET! | ||
======================== | ||
## Introduction | ||
Plugin for [website-scraper](https://github.com/s0ph1e/node-website-scraper) which returns html for dynamic websites using PhantomJS. | ||
|
||
## Installation | ||
```sh | ||
npm install website-scraper website-scraper-phantom | ||
``` | ||
|
||
## Usage | ||
```javascript | ||
const scrape = require('website-scraper'); | ||
const phantomHtml = require('website-scraper-phantom'); | ||
|
||
scrape({ | ||
urls: ['https://www.instagram.com/gopro/'], | ||
directory: '/path/to/save', | ||
httpResponseHandler: phantomHtml | ||
}).then(console.log).catch(console.log); | ||
``` | ||
|
||
## How it works | ||
It starts PhantomJS which just opens page and waits when page is loaded. | ||
It is far from ideal because probably you need to wait until some resource is loaded or click some button or log in. Currently this module doesn't support such functionality. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
{ | ||
"name": "website-scraper-phantom-html", | ||
"version": "0.0.0", | ||
"description": "", | ||
"name": "website-scraper-phantom", | ||
"version": "0.1.0", | ||
"description": "Plugin for website-scraper which receives html for dynamic websites using PhantomJS", | ||
"readmeFilename": "README.md", | ||
"main": "index.js", | ||
"keywords": [ | ||
"website-scraper", | ||
"phantomjs", | ||
"html" | ||
], | ||
"dependencies": { | ||
"phantomjs-prebuilt": "^2.1.14", | ||
"system": "^1.2.0", | ||
|
@@ -15,12 +21,12 @@ | |
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/s0ph1e/node-website-scraper-phantom-html.git" | ||
"url": "git+https://github.com/s0ph1e/node-website-scraper-phantom.git" | ||
}, | ||
"author": "s0ph1e", | ||
"author": "Sophia Antipenko <[email protected]>", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/s0ph1e/node-website-scraper-phantom-html/issues" | ||
"url": "https://github.com/s0ph1e/node-website-scraper-phantom/issues" | ||
}, | ||
"homepage": "https://github.com/s0ph1e/node-website-scraper-phantom-html#readme" | ||
"homepage": "https://github.com/s0ph1e/node-website-scraper-phantom" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters