Because Webdriver waits for the entire page to load before going on to the next line, I think disabling images, css and javascript will speed things up.
from selenium import webdriver
from selenium.webdriver.firefox.firefox_profile import FirefoxProfile
def disableImages(self):
## get the Firefox profile object
firefoxProfile = FirefoxProfile()
## Disable CSS
firefoxProfile.set_preference('permissions.default.stylesheet', 2)
## Disable images
firefoxProfile.set_preference('permissions.default.image', 2)
## Disable Flash
firefoxProfile.set_preference('dom.ipc.plugins.enabled.libflashplayer.so',
'false')
## Set the modified profile while creating the browser object
self.browserHandle = webdriver.Firefox(firefoxProfile)
I got the code from stackoverflow Do not want images to load and CSS to render on Firefox in Selenium WebDriver tests with Python
But when I add
driver = webdriver.Firefox()
driver.get("http://www.stackoverflow.com/")
to the end, it still loads images :/