Skip to content

Instantly share code, notes, and snippets.

@blanc0
Last active January 20, 2016 08:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save blanc0/65a0c4f3dc148c66ad38 to your computer and use it in GitHub Desktop.
Save blanc0/65a0c4f3dc148c66ad38 to your computer and use it in GitHub Desktop.
PhantomJS + Selenium Testing
'''
You'll need to install npm, nodejs and phantomjs
$ apt-get install nodejs nodejs-dev npm phantomjs
$ pip install selenium-python
'''
from selenium import webdriver
browser = webdriver.PhantomJS()
browser.get('http://thewebsite.com/')
browser.find_element_by_css_selector("input[name='Agree'][value=Yes']").click()
browser.save_screenshot('screenshot.png')
# etc,etc
browser.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment