1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

casper.jsで要素とキャプチャーの取得

Last updated at Posted at 2016-07-15

要素とキャプチャーってこんなに簡単に取得できるんだ。
という事で、備忘録。

var casper = require("casper").create();
casper.start();
casper.thenOpen(URL,function() {
  this.repeat(2,function(){

    // 要素
    var xpath = 'XPath';
    var element = this.evaluate(function(path){
                return __utils__.getElementByXPath(path).innerHTML;
    },xpath);
  });

  // キャプチャ
  var filename = "aaa.png";
  this.capture(filename);
});

casperjs でなんかいろいろとやってみたい。

1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?