ip, port = "192.168.1.1", "443"
firefox_profile = webdriver.FirefoxProfile()
firefox_profile.set_preference("network.proxy.type", 1)
firefox_profile.set_preference("network.proxy.socks", ip)
firefox_profile.set_preference("network.proxy.socks_port", int(port))
driver = webdriver.Firefox(firefox_profile)