简体   繁体   中英

How to get HTTP Response Code using Selenium(-Wire)

is there any Way, without using a Proxy, to catch the Network Response with Selenium(-Wire)?

文本

With selenium wire yes.

driver.last_request.response

for the last response.

You can also get the first or all responses.

print(driver.last_request.response)

Will, in your case, print "200 OK"

You can also get just the response code with:

driver.last_request.response.status_code

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM