Last active
September 19, 2015 09:56
-
-
Save matsuhisa/b63b6aeebb4b0d6322d2 to your computer and use it in GitHub Desktop.
page_title.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var url = phantom.args[0] || 'http://www.yahoo.co.jp/'; | |
page = new WebPage(); | |
page.open(url, function(stat){ | |
if(!stat){ | |
phantom.exit(); | |
} | |
else{ | |
var title = page.evaluate(function(){ | |
return document.title; | |
}); | |
console.log(title); | |
phantom.exit(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
下記で実行
$ phantomjs page_title.js Yahoo! JAPAN