AttributeError: 'FirefoxProfile' object has no attribute 'set_proxy'

Viewed 184

Hi I'm trying to run this:

from browsermobproxy import Server
server = Server('path')
server.start()
proxy = server.create_proxy()

from selenium import webdriver
profile = webdriver.FirefoxProfile()
profile.set_proxy(proxy.selenium_proxy())
driver = webdriver.Firefox(firefox_profile=profile)

proxy.new_har("google")
driver.get("http://www.google.co.in")

server.stop()
driver.quit()

But I'm getting this: AttributeError: 'FirefoxProfile' object has no attribute 'set_proxy'

I'm not sure why but everywhere I look people use profile.set_proxy(proxy.selenium_proxy())

0 Answers
Related