Browser
To use splinter you need create a Browser instance:
from splinter.browser import Browser
browser = Browser()
splinter support three drivers: chrome, firefox and zopetestbrowser
browser = Browser('webdriver.chrome')
browser = Browser('webdriver.firefox')
browser = Browser('zope.testbrowser')
Navigating with Browser.visit
You can use the visit method to navigate to other pages:
browser.visit('http://cobrateam.info')
The visit method takes only a single parameter - the url to be visited.
Reload a page
You can reload a page using reload method:
Navigate through the history
You can back and forward on your browsing history using back and forward methods:
browser.visit('http://cobrateam.info')
browser.visit('http://splinter.cobrateam.info')
browser.back()
browser.forward()
Browser.title
You can get the title of the visited page using the title attribute:
Verifying page content with Browser.html
You can use the html attribute to get the html content of the visited page:
Verifying page url with Browser.url
The visited page’s url can be accessed by the url attribute: