Skip to content

Instantly share code, notes, and snippets.

@mralbu
Created December 23, 2014 16:01
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 mralbu/09041e45482458e85c9c to your computer and use it in GitHub Desktop.
Save mralbu/09041e45482458e85c9c to your computer and use it in GitHub Desktop.
Phantomjs Splinter Gist
import splinter
url = 'http://todomvc.com/examples/angularjs/#/'
b = splinter.Browser('phantomjs')
b.visit(url)
newtodo_input = b.find_by_id('new-todo').first
newtodo_input.fill('splinter rocks\n')
newtodo_input.fill('phantomjs rocks\n')
print [label.text for label in b.find_by_xpath('//label')]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment