0.0.0 • Published 8 years ago

plant.js v0.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

plant.js

var Plant = require('plant.js');

var browser = new Plant(); // <- You can pass defaults for request. 
browser.get('http://www.theuselessweb.com/')

.then(function($) {
  console.log($('h3').text()); // USELESS
  return browser.follow('a:nth-child(2)'); // <- Follows link with this selector
})

.then(function($) {
  console.log($('.text-holster h1').text()); // SHUT UP& LOOK
  return browser.get('http://www.theuselessweb.com/');
})

.then(function($) {
  console.log($('h3').text()); // USELESS
})

.catch(function(e) {
  return console.trace(e);
});