from selenium import webdriver
import sys
sys.path.append("/home/sgalkov/browsermob-proxy-py/")
from browsermobproxy import Server
server = Server("/home/sgalkov/browsermob/browsermobproxy/bin/browsermob-proxy")
server.start()
proxy = server.create_proxy()
proxy.new_har("google")
#initialize HIDDEN display
display = Display(visible=0, size=(800, 600))
display.start()
#initialize webdriver
browser = webdriver.Firefox()
print browser.title
But still, my output isn't giving me a HAR output, all I get from proxy.har() is:
['__call__', '__class__', '__cmp__', '__delattr__', '__doc__', '__format__', '__func__', '__get__', '__getattribute__', '__hash__', '__init__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__self__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'im_class', 'im_func', 'im_self']
{u'log': {u'version': u'1.1', u'creator': {u'version': u'2.0', u'name': u'BrowserMob Proxy'}, u'pages': [{u'title': u'', u'startedDateTime': u'2013-01-31T19:04:00.128+0000', u'id': u'google', u'pageTimings': {}}], u'entries': []}}
<!DOCTYPE html>
<html xmlns="
http://www.w3.org/1999/xhtml" itemtype="
http://schema.org/WebPage" itemscope="itemscope"><head><meta name="description" content="Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for." /><meta name="robots" content="noodp" /><meta content="/images/google_favicon_128.png" itemprop="image" /><title>Google</title><script>(function(){
window.google={kEI:"IcAKUaHqM6u3iALo34H4Cw",getEI:function(a){for(var b;a&&(!a.getAttribute||!(b=a.getAttribute("eid")));)a=a.parentNode;return b||google.kEI},https:function(){return"https:"==window.location.protocol},kEXPI:"17259,18168,39523,39978,4000116,4001569,4001959,4001975,4002001,4002159,4002208,4002378,4002436,4002562,4002700,4002734,4002858,4002928,4003035,4003215,4003225,4003318,4003335,4003341,4003371,4003518,4003654,4003687",kCSI:{e:"17259,18168,39523,39978,4000116,4001569,4001959,4001975,4002001,4002159,4002208,4002378,4002436,4002562,4002700,4002734,4002858,4002928,4003035,4003215,4003225,4003318,4003335,4003341,4003371,4003518,4003654,4003687",ei:"IcAKUaHqM6u3iALo34H4Cw"},authuser:0,ml:function(){},pageState:"#",kHL:"en",time:function(){return(new Date).getTime()},log:function(a,
b,c,i){var d=new Image,f=
google.lc,e=
google.li,g="";d.onerror=d.onload=d.onabort=function(){delete f[e]};f[e]=d;!c&&-1==b.search("&ei=")&&(g="&ei="+google.getEI(i));c=c||"/gen_204?atyp=i&ct="+a+"&cad="+b+g+"&zx="+google.time();a=/^http:/i;a.test(c)&&google.https()?(
google.ml(Error("GLMM"),!1,{src:c}),delete f[e]):(d.src=c,
google.li=e+1)},lc:[],li:0,j:{en:1,l:function(){google.fl=!0},e:function(){google.fl=!0},b:!!location.hash&&!!location.hash.match("[#&]((q|fp)=|tbs=simg|tbs=sbi)"),bv:21,cf:"",
pm:"p",pl:[],mc:0,sc:0.5,u:"c9c918f0"},Toolbelt:{},y:{},x:function(a,b){google.y[
a.id]=[a,b];return!1},load:function(a,b){google.x({id:"l"+a},function(){google.load(a,b)})}};
window.onpopstate=function(){google.j.psc=1};for(var h="ad api bc is p pa ac pc pah ph sa sifp slp spf spn xx zc zz".split(" "),j=0,k;k=h[j++];)(function(a){google.j[a]=function(){google.j.pl.push([a,arguments])}})(k);
.
.
.
.
.
.
.
.
.
.
.
But no HAR output...