wkeeling / selenium-wire

Extends Selenium's Python bindings to give you the ability to inspect requests made by the browser.
MIT License
1.86k stars 241 forks source link

Not able to Capture request in safari #676

Open Akash-nykaa opened 1 year ago

Akash-nykaa commented 1 year ago

HI Team,

I am a beginner with the selenium-wire, I wanted to capture request on safari, I did all the configuration as found but still request are not getting captured.

Need your assistance on this.

from selenium.webdriver.safari.service import Service as SafariService from seleniumwire import webdriver as wirewebdriver from pathlib import Path from selenium.webdriver.safari.options import Options as SafariOptions

ROOT_DIR_PROJECT = Path(file).parent option = SafariOptions() option.binary_location = "/usr/bin/safaridriver" safari_service = SafariService('/usr/bin/safaridriver') option.service = safari_service sw = {'port': 8090} driver = wirewebdriver.Safari(options=option, seleniumwire_options=sw) driver.get("http://www.google.co.uk") driver.maximize_window() for request in driver.requests: if request.response: print( request.url, request.response.status_code, request.response.headers['Content-Type'] ) driver.quit()

OUTPUT Gives empty request