I am using Selenium 2 with python bindings to fetch some data from our partner's site. But on an average it's taking me around 13 secs to perform this operation.
I was looking for a way to disable the images css and flash etc.
I am using Firefox 3.6 and also using pyvirtualdisplay to to prevent opening of firefox window. Any other optimization to speed up firefox will be also helpful.
I have already tried
permissions.default.image = 2
I have figured out a way to prevent Firefox from loading CSS, images and Flash.
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)
Thanks again @Simon and @ernie for your suggestions.