Skip to content

Instantly share code, notes, and snippets.

@vimtaku
Created December 13, 2012 06:08
Show Gist options
  • Save vimtaku/4274452 to your computer and use it in GitHub Desktop.
Save vimtaku/4274452 to your computer and use it in GitHub Desktop.
var casper = require('casper').create({
clientScripts:['jquery.min.js'],
});
phantom.injectJs('jquery.min.js');
casper.start('http://mixi.jp/', function() {
this.fill('form[name="login_form"]', {
email: '',
password: ''
}, true);
});
casper.then(function() {
this.fill('form.JS_formPageSearch', {
keyword: 'ソノダバンド',
}, true);
var title = this.evaluate(function(){
return document.title;
});
console.log(title);
});
casper.then(function() {
var title = this.evaluate(function(){
return document.title;
});
console.log(title);
this.click('div.listIcon > a');
});
casper.run(function() {
var title = this.evaluate(function(){
return document.title;
});
console.log(title);
this.capture('sonodaband.png', {
top:0,
left:0,
width:1563,
height:2000,
});
casper.exit();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment