Created
April 30, 2014 15:59
-
-
Save jedahan/aa3f93f458413b6965bb to your computer and use it in GitHub Desktop.
scrape google
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
casper = require("casper").create | |
logLevel: "debug" | |
casper.start "https://www.google.com/", -> | |
@test.assertTitle "Google", "google homepage title is the one expected" | |
@test.assertExists 'form[action="/search"]', "main form is found" | |
@fill 'form[action="/search"]', q: "foo", true | |
casper.then -> | |
console.log @fetchText("span.st") | |
casper.run -> | |
@test.renderResults true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment