selenium-wire icon indicating copy to clipboard operation
selenium-wire copied to clipboard

Requests not being captured

Open awilson10pyx opened this issue 2 years ago • 2 comments

Doing the most basic operations with selenium-wire and the requests array always lists as empty. I'm guessing there's an unsupported library installed but not sure how to ensure compatibility

VS Code 1.81.1 chromedriver 115.0.5790.170 python 3.10.11 selenium 4.11.2 selenium-wire 5.1.0

test.py ------

from seleniumwire import webdriver

driver = webdriver.Chrome()

driver.get('https://www.google.com/')

for request in driver.requests: if request.response: print( request.url, request.response.status_code, request.response.headers['Content-Type'] )

Chrome opens and navigates to google then closes

awilson10pyx avatar Aug 10 '23 20:08 awilson10pyx

I slightly modified it with the same results ... added the console output. Any advice would be greatly appreciated.

if True: driver.get("https://www.google.com/") time.sleep(5) print(driver.requests) driver.quit()

DevTools listening on ws://127.0.0.1:56700/devtools/browser/95763f06-399c-4055-ab0b-324666c91e1a []

awilson10pyx avatar Aug 11 '23 12:08 awilson10pyx

I've never used it like that. I always used the interceptor functionality as described here. Did your request to google actually finish?

My current code base is a bit dated due to temporary shifted priorities (it will shift back to add selenium-wire intercept chrome stuff soon).

PatrickAlliander avatar Aug 14 '23 07:08 PatrickAlliander