blob: 0a568cf643246b1c0e20b2db4f82e475f2dfcffc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
.. BrowserMob Proxy documentation master file, created by
sphinx-quickstart on Fri May 24 12:37:12 2013.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
.. highlightlang:: python
Welcome to BrowserMob Proxy's documentation!
============================================
Python client for the BrowserMob Proxy 2.0 REST API.
How to install
--------------
BrowserMob Proxy is available on PyPI_, so you can install it with ``pip``::
$ pip install browsermob-proxy
Or with `easy_install`::
$ easy_install browsermob-proxy
Or by cloning the repo from GitHub_::
$ git clone git://github.com/AutomatedTester/browsermob-proxy-py.git
Then install it by running::
$ python setup.py install
How to use with selenium-webdriver
----------------------------------
Manually::
from browsermobproxy import Server
server = Server("path/to/browsermob-proxy")
server.start()
proxy = server.create_proxy()
from selenium import webdriver
profile = webdriver.FirefoxProfile()
profile.set_proxy(proxy.selenium_proxy())
driver = webdriver.Firefox(firefox_profile=profile)
proxy.new_har("google")
driver.get("http://www.google.co.uk")
proxy.har # returns a HAR JSON blob
server.stop()
driver.quit()
Contents:
.. toctree::
:maxdepth: 2
client.rst
server.rst
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
.. _GitHub: https://github.com/AutomatedTester/browsermob-proxy-py
.. _PyPI: http://pypi.python.org/pypi/browsermob-proxy
|