Best How To :
Selenium is a browser automation tool. You can basically automate everything you can do in your browser. Start with going through the Getting Started section of the documentation.
from selenium import webdriver
driver = webdriver.Firefox()
Besides automating common browsers, like Chrome, Firefox, Safari or Internet Explorer, you can also use
PhantomJS headless browser.