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

browsermob-proxy-selenium is not giving _transferSize in the exported .har file with firefox/chrome profile #886

Open
prantik111 opened this issue Nov 22, 2021 · 0 comments

Comments

@prantik111
Copy link

prantik111 commented Nov 22, 2021

I am trying to export har file using selenium and browsermob-proxy using the below code:

import time
from browsermobproxy import Server
from selenium import webdriver

bmp_loc = "/Users/PycharmProjects/browsermob-proxy-2" \
          ".1.4/bin/browsermob-proxy"
server = Server(bmp_loc)
server.start()
proxy = server.create_proxy()

selenium_proxy = proxy.selenium_proxy()
caps = webdriver.DesiredCapabilities.FIREFOX
caps['marionette'] = True

proxy_settings = {
    "proxyType": "MANUAL",
    "httpProxy": selenium_proxy.httpProxy,
    "sslProxy": selenium_proxy.sslProxy,
}
caps['proxy'] = proxy_settings

driver = webdriver.Firefox(desired_capabilities=caps)
driver.maximize_window()
proxy.new_har("generated_har",options={'captureHeaders': True})
driver.get("https://google.com")
driver.implicitly_wait(10)
browser_logs = proxy.har
print(browser_logs)
server.stop()
driver.quit()

In the .har file I want to get the _transferSize for my analysis but it's coming as "redirectURL": "", "headersSize": 1023, "bodySize": 38, "comment": ""
Any help would be appreciated.

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

1 participant