Created
July 16, 2017 20:06
-
-
Save vector623/c37434e04f565fcc4b733d3a59f2892f 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
var page = require('webpage').create(); | |
page.open('http://davidgallmeier.com', function() { | |
page.includeJs("http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js", function() { | |
var results = page.evaluate(function() { | |
var firstlinktext = $('a.post-link:first'). | |
text(). | |
toString(); | |
var firstlinkhref = $('a.post-link'). | |
map(function () { | |
return $( this ).attr('href'); | |
})[0]. | |
toString(); | |
//return firstlinktext; | |
return firstlinkhref; | |
}); | |
console.log(results); | |
phantom.exit() | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment