Created
February 3, 2011 13:56
-
-
Save uu59/809492 to your computer and use it in GitHub Desktop.
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
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