browsermob-proxy-py icon indicating copy to clipboard operation
browsermob-proxy-py copied to clipboard

profile.set_proxy(proxy.selenium_proxy())

Open BourneXu opened this issue 6 years ago • 5 comments

When I use profile.set_proxy(proxy.selenium_proxy()), it rasies warning that

This method has been deprecated. Please pass in the proxy object to the Driver Object", DeprecationWarning

Especially, after I upgrade my Firefox to 63.0, it cannot run totally. Do you guys know how to use another way to deploy this proxy? Should I set proxy when I call selenium.webdriver.Firefox(proxy=?) What parameter should I input?

BourneXu avatar Oct 29 '18 21:10 BourneXu

Did you get any solution for this?

BrandonEm avatar Apr 24 '19 18:04 BrandonEm

This doesn't work for whatever reason. No exception, but when retrieving the HAR, there are no entries at all.

server = ProxyServer("browsermob-proxy-2.1.4/bin/browsermob-proxy")
server.start()
proxy = server.create_proxy()
driver = webdriver.Firefox(proxy=proxy.selenium_proxy())

The old solution with the deprecation warning does, though. (Firefox 68.0.2)

kangalio avatar Aug 28 '19 14:08 kangalio

How do you solve this problem? Thank you

lihaoaini2008 avatar May 06 '20 02:05 lihaoaini2008

How do you solve this problem? Thank you

This doesn't work for whatever reason. No exception, but when retrieving the HAR, there are no entries at all.

server = ProxyServer("browsermob-proxy-2.1.4/bin/browsermob-proxy")
server.start()
proxy = server.create_proxy()
driver = webdriver.Firefox(proxy=proxy.selenium_proxy())

The old solution with the deprecation warning does, though. (Firefox 68.0.2)

I have the same problem as you.

point86 avatar Aug 28 '20 02:08 point86

Try my version Firefox 88.0.1 Python 3.9 browsermob-proxy 0.8.0

    from browsermobproxy import Server
    server = Server("path/to/browsermob-proxy")
    server.start()
    time.sleep(1)
    proxy = server.create_proxy()
    time.sleep(1)
    
    from selenium import webdriver
    proxy_firefox = proxy.proxy
    caps = webdriver.DesiredCapabilities.FIREFOX
    caps['marionette'] = True
    caps['proxy'] = {
        "proxyType": "MANUAL",
        "httpProxy": proxy_firefox,
        "ftpProxy": proxy_firefox,
        "sslProxy": proxy_firefox
    }
    driver = webdriver.Firefox(capabilities=caps)

... result = json.dumps(proxy.har.get('log'), ensure_ascii=False) # proxy.har.get

Serg123-ent avatar May 21 '21 23:05 Serg123-ent