I want to set a custom profile for Firefox using Selenium module. Here is my code:
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
class oo1():
def __init__(self, url):
self.url = url
def fps(self):
print 'running fp'
self.profile = webdriver.FirefoxProfile()
self.profile.set_preference('network.proxy.type', '1')
self.profile.set_preference('network.proxy.socks_remote_dns', 'true')
self.profile.set_preference('network.cookie.cookieBehaviour', '2')
self.profile.set_preference('javascript.enabled', 'False')
self.profile.update_preferences()
def driverr(self):
print 'running'
self.web = webdriver.Firefox(firefox_profile=self.profile)
self.web.get(self.url)
s = oo1('127.0.0.1')
s.fps()
s.driverr()
When I run the above code, Firefox runs properly but none of the settings that I wrote above are applied to the Firefox.
What is the problem and How do I fix that?