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

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

Open prantik111 opened this issue 4 years ago • 0 comments

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.

prantik111 avatar Nov 22 '21 08:11 prantik111