site-snapshot
v0.1.0
Published
Create a screenshot of web page in PDF
Downloads
11
Readme
site-snapshot
site-snapshot is a tool to capture the webpage while crawling specified links of the page.
Install
$ npm install -g site-snapshot
Usage
$ siteshot --help
Usage: siteshot [options]
Options:
-V, --version output the version number
-s, --sitefile [sitefile] The path to site.json file
-h, --help
site.json
site-snapshot need to receive a json file which specifies the path to be crawled. The format of the file is here.
{
"name": "index",
"selector": null,
"baseUrl": "http://www.lewuathe.com",
"children": [
{
"name": "menu",
"selector": ".element",
"children": []
}
]
}
With this file, site-snapshot tries to crawl recursively.
- Capture root page
- Capture child pages specified by selector in children object
Snapshot is created in index
directory in this case.
$ tree index
index
├── index.html.pdf
└── menu
├── menu-about.pdf
├── menu-contact.pdf
└── menu-writing.pdf
1 directory, 4 files