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

Unable to get request in debug mode #671

Open yinyerong opened 1 year ago

yinyerong commented 1 year ago
  1. google browser open debug mode:chrome.exe --remote-debugging-port=9222 --user-data-dir="D:\tmp"
  2. then run script, but driver.requests return [].

option = webdriver.ChromeOptions()

option.debugger_address = '127.0.0.1:9222'

driver = webdriver.Chrome(GOOGLE_DRIVER_PATH, options=option)
driver.request_interceptor = interceptor
while True:
    driver.get("https://www.google.com/")
    time.sleep(5)
    print(driver.requests)
driver.quit()