I am trying to use BrowserMob Proxy with browsermob-proxy-py on Python. I need to capture URLs of all requests from the page. But I can't find https requests in the HAR file. Selenium and BrowserMob Proxy are running on remote machine.
Example code:
from selenium import webdriver
import browsermobproxy
SELENIUM_EXECUTOR = 'http://<remote_ip>:4444/wd/hub'
SELENIUM_DESIRED_CAPABILITIES = {
'browserName': 'firefox',
'version': '20.0.0',
'javascriptEnabled': True,
}
prox = browsermobproxy.Client('<remote_ip>:8080')
driver = webdriver.Remote(
command_executor=SELENIUM_EXECUTOR,
desired_capabilities=SELENIUM_DESIRED_CAPABILITIES,
proxy=prox)
url_to_get = 'http://google.ru'
prox.new_har()
driver.get(url_to_get)
for ent in prox.har['log']['entries']:
print ent['request']['url']
driver.quit()
prox.close()
This example returns 5 http requests.
But if I change url_to_get to 'https://...', I will see only 3 http requests, and none https requests
Does anyone know how to catch https headers too?