Giter VIP home page Giter VIP logo

webscreenshot's Introduction

webscreenshot

Présentation

Capture d'écrans web en lot à l'aide de phantomjs (car échec avec code casper.js, cf code à la fin).

Usage

  • cd webscreenshot
  • vi webscreenshot.js :

    • corriger variable arrayUrls pour ajouter les url à capturer en lot
    • corriger page.viewportSize pour définir taille capture écran
    • corriger writePath pour définir le répertoire où déposer les captures
  • phantomjs webscreenshot.js (ou F5 depuis SciTE si properties.directory.enable=1)

Installation

  • Installer http://phantomjs.org/ et ajouter exéuctable dans PATH
  • git clone https://github.com/ami44/webscreenshot.git

Todo

  • passer en argument un fichier json des urls à capturer
  • indiquer un répertoire de destination
  • voir code phantomjs-screenshots

Exemples phantomjs utiles :

Code casper.js

fonctionne mais le résulat n'est pas exactement ce qui est attendu ! :

phantom.casperPath = 'C:\\Documents and Settings\\ami44\\Mes documents\\casperjs';
phantom.injectJs(phantom.casperPath + '\\bin\\bootstrap.js');
var utils = require('utils'); // inclus dans casper.js

var casper = require('casper').create({});
casper.start();
casper.open('http://backbone4.localhost');
casper.then(function() {
    this.wait(3000, function() { // le temps que le javascript soit exécuté
        this.captureSelector('weather.png','html');
    });
});
casper.run(function() {
    this.exit();
});

scite :

command.go.$(file.patterns.js)="C:\Program Files\phantomjs-1.6.1\phantomjs.exe" $(FileNameExt)

webscreenshot's People

Contributors

albanminassian avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.