Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

profile.set_proxy(proxy.selenium_proxy()) #89

Open
BourneXu opened this issue Oct 29, 2018 · 5 comments
Open

profile.set_proxy(proxy.selenium_proxy()) #89

BourneXu opened this issue Oct 29, 2018 · 5 comments

Comments

@BourneXu
Copy link

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?

@BrandonCardenasG
Copy link

Did you get any solution for this?

@kangalio
Copy link

kangalio commented Aug 28, 2019

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)

@lihaoaini2008
Copy link

How do you solve this problem? Thank you

@point86
Copy link

point86 commented Aug 28, 2020

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.

@Serg123-ent
Copy link

Serg123-ent commented May 21, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants