html-puzzle
v0.5.1
Published
A tiny, easy to use, html grabber
Downloads
5
Readme
Html-Puzzle
A tiny, easy-to-use, html grab and package library. Tested with Node 0.10.12
Requirements
PhantomJS (if you want to create a page snapshot)
Install
npm -S install html-puzzle
Use
var grabber = require('../index');
var imageFormat = 'jpeg'
, options = {
url: 'https://github.com/plasticpanda/html-puzzle',
createSnapshot: true,
createHTML: true,
imageFormat: imageFormat
};
grabber.grab(options, function (err, page) {
// do awesome stuff
// page.html contains the html code
// page.image contains the base64 encoded image
});
See tests/test.js for more information.
Performance
Time to grab arstechnica.com using a 100Mbps fiber connection on a Virtual Machine (512MB RAM, 1 core).
Todo
- Add javascript blacklist (eg: google analytics..)
- Fix problem with js/css loaded resources
- Test with strange characters
- Test performances
License
Copyright (c) 2013 PlasticPanda.com, Mauro Bolis [email protected], Simone Lusenti [email protected]
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.