AutomatedTester / browsermob-proxy-py

A python wrapper for Browsermob Proxy
http://oss.theautomatedtester.co.uk/browsermob-proxy-py
236 stars 104 forks source link

Capturing of HAR for youtube videos from chrome at the end of duration #57

Closed SivaKesava1 closed 8 years ago

SivaKesava1 commented 8 years ago

Hi all, Is there a way to capture HAR for a youtube video at the end of its duration?Through the following code it is capturing the HAR at the start of the video itself.What modifications need to be done if I don't know the duration in advance.

server=Server('path to browsermob-proxy') server.start() proxy=server.create_proxy() from selenium import webdriver chrome_options = webdriver.ChromeOptions() chrome_options.add_argument("--proxy-server={0}".format(proxy.proxy)) browser = webdriver.Chrome(executable_path="/home/sivakesava/chromedriver",chrome_options = chrome_options) proxy.new_har("CS") browser.get("https://www.youtube.com/watch?v=NFQeItqTfZk") har=proxy.har print har browser.quit() server.stop()

AutomatedTester commented 8 years ago

This is a great question for the BrowserMob Proxy Google Group.