aboutsummaryrefslogtreecommitdiff
path: root/www/py-selenium-wire/pkg-descr
blob: 131becc04556647b270d44aa020ee8a32934c0b7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Selenium Wire extends Selenium's Python bindings to give you access to the
underlying requests made by the browser. You author your code in the same way as
you do with Selenium, but you get extra APIs for inspecting requests and
responses and making changes to them on the fly.

Simnple example:

from seleniumwire import webdriver  # Import from seleniumwire

# Create a new instance of the Chrome driver
driver = webdriver.Chrome()

# Go to the Google home page
driver.get('https://www.google.com')

# Access requests via the `requests` attribute
for request in driver.requests:
    if request.response:
        print(
            request.url,
            request.response.status_code,
            request.response.headers['Content-Type']
        )