browsermob-proxy-py
browsermob-proxy-py copied to clipboard
profile.set_proxy(proxy.selenium_proxy())
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?
Did you get any solution for this?
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)
How do you solve this problem? Thank you
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.
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