Skip to content

Instantly share code, notes, and snippets.

@crazy4groovy
Last active August 29, 2015 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crazy4groovy/32e6ed9ee2e275f08653 to your computer and use it in GitHub Desktop.
Save crazy4groovy/32e6ed9ee2e275f08653 to your computer and use it in GitHub Desktop.
Screenscraper snipet for Selenium (NodeJS)
//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