var casper = require('casper').create({

    logLevel: "error",

    verbose: true

});


var url = "http://ladder.named.com/main.php";

var fs = require('fs');

var path = 'output2.txt';


casper.start(url, function() {


    console.log("크롤링 시작");


    var content = JSON.parse(fs.read(path));

    console.log("불러온 쿠키: " + JSON.stringify(content));

    

    console.log("현재 쿠키: " + JSON.stringify(phantom.cookies));

    

    phantom.cookies = content;

    console.log("저장된 쿠키: " + JSON.stringify(phantom.cookies));


});


casper.run(function() {

    this.close();

});


핵심포인트

phantom.cookies

블로그 이미지

칩사마코더

,