Skip to content

Instantly share code, notes, and snippets.

@uu59
Created February 3, 2011 13:56
Show Gist options
  • Save uu59/809492 to your computer and use it in GitHub Desktop.
Save uu59/809492 to your computer and use it in GitHub Desktop.
if (!phantom.state) {
// request process
phantom.state = 'betuyaku';
var url = "http://portal.nifty.com/2011/01/index.htm";
phantom.open(url);
} else {
// response process
(function(){
var jquerySrc = "https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js";
var s = document.createElement('script');
s.src = jquerySrc;
s.onload = function(){
var arts = [];
jQuery('font.gray10').each(function(i, font){
if(font.innerHTML == '(べつやくれい)'){
arts.push(jQuery('a', font.parentNode).attr('href'));
}
});
console.log(arts.join("\n"));
phantom.exit();
};
document.body.appendChild(s);
})();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment