Created
September 2, 2016 17:13
-
-
Save joelbrewer/b063044cee695ae6a1ae1419849d0611 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/* | |
console.log('Hello, world!'); | |
phantom.exit(); | |
*/ | |
var page = require('webpage').create(); | |
var url = 'http://bananarepublic.gap.com/browse/product.do?pid=249853002'; | |
page.open(url); | |
page.onLoadFinished = function() { | |
console.log("onLoadFinished()"); | |
page.evaluate(function(){ | |
var images = document.getElementsByTagName('img'); | |
var num_images = document.getElementsByTagName('img').length; | |
console.log("images : ", images); | |
console.log("num_images : ", num_images); | |
console.log("images[0] :", images[0]); | |
phantom.exit(); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment