Last active
August 29, 2015 14:20
-
-
Save crazy4groovy/32e6ed9ee2e275f08653 to your computer and use it in GitHub Desktop.
Screenscraper snipet for Selenium (NodeJS)
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
//curl -O http://selenium-release.storage.googleapis.com/2.45/selenium-server-standalone-2.45.0.jar | |
//java -jar selenium-server-standalone-2.45.0.jar | |
//npm install webdriverio | |
var webdriverio = require('webdriverio'); | |
var options = { | |
desiredCapabilities: { | |
browserName: 'firefox' | |
} | |
}; | |
webdriverio | |
.remote(options) | |
.init() | |
.url('http://www.google.com') | |
.title(function(err, res) { | |
console.log('Title was: ' + res.value); | |
}) | |
.getAttribute('img', 'src', function(err, resp) { | |
console.log(resp.length); | |
console.log(resp); | |
}) | |
.end(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment