I'm having trouble with:
from browsermobproxy import Server
Please see below:
[sgalkov@zpub-web-203 browsermob-proxy-2.0-beta-7]$ python display.py
Google
[sgalkov@zpub-web-203 browsermob-proxy-2.0-beta-7]$ cat display.py
from pyvirtualdisplay import Display
from selenium import webdriver
#from browsermobproxy import Server
#server = Server("/home/sgalkov/browsermob/browsermob-proxy-2.0-beta-7/
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()
browser.get('
http://www.google.com')
print browser.title
#proxy.har
browser.quit() #important, or else loaded browser will remain running
as a bg proc!
display.stop()
#server.stop()
[sgalkov@zpub-web-203 browsermob-proxy-2.0-beta-7]$ pwd
/home/sgalkov/browsermob/browsermob-proxy-2.0-beta-7
#here i'm uncommenting the browsermobproxy Server import
[sgalkov@zpub-web-203 browsermob-proxy-2.0-beta-7]$ vi display.py
[sgalkov@zpub-web-203 browsermob-proxy-2.0-beta-7]$ python display.py
Traceback (most recent call last):
File "display.py", line 3, in <module>
from browsermobproxy import Server
ImportError: No module named browsermobproxy
[sgalkov@zpub-web-203 browsermob-proxy-2.0-beta-7]$
after I uncomment:
from browsermobproxy import Server
the script won't run because it cannot find that library although that
library is right there in that folder and the bin is there, I just
dont understand how it should include it and ive searched everywhere
online. It must be something really trivial that I don't understand
because i can't find anybody else complain about it. As you can see,
the other two libraries on top of the file are easily found by the
script because they were installed via easy_install/pip/yum but
browsermobproxy was simply gunzipped so i believe it isn't included in
the global path.
I downloaded and gunzipped this file:
http://dl.dropbox.com/u/1995643/browsermob-proxy/browsermob-proxy-2.0-beta-7-bin.zip
as instructed on
http://opensource.webmetrics.com/browsermob-proxy/
any help would be greatly appreciated, I have been trying to get this
working for a number of days now.
My linux box is CentOS6.2 and I'm trying to run headless selenium tests