-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to get status code. #98
Comments
@atsman briefly, it requires some tweaks described there: https://stackoverflow.com/questions/6509628/how-to-get-http-response-code-using-selenium-webdriver-with-java Currently, you may set your own LogType preferences passing some particular |
I can confirm that I've been able to retrieve http response status from chrome perf logs using the solution in the stackoverflow link posted, but it took ages of poking around, passing the right flags into chromedriver, then retrieving and parsing the logs themselves. |
It's a pleasure using this library! https://chromedevtools.github.io/devtools-protocol/tot/Network/#event-responseReceivedExtraInfo Since now we got this api (though marked as experimental), maybe we can add the related data to the |
Thanks for the comment @lotuc! I'll re-open this issue so we don't forget about it. |
So, @lotuc this isn't part of the w3c spec, and is experimental, so we probably won't include it in the etaoin API. But... if you can provide me with a working code example, it might be nice to include it in the user guide of something browser-custom folks can do. |
OK, here is my dirty patch gist. I just copy the whole etaoin.dev. The changed part is Line 70 - Line 75 & Line 90 - Line 94. Sample: (def d (etaoin.api/chrome {:dev {}}))
(etaoin.api/go d "https://www.bing.com")
(def requests (etaoin.dev-patch/get-requests d)) ;; replace the etaoin.dev
(-> (first requests) :response :status-code) ;; the :status-code is only added compare to original etaoin.dev/get-requests
;; we get the status code here |
Thanks @lotuc! I kinda sorta forgot we have a dedicated namespace to support chrome dev tools. Once this moves out of the experimental state your gist will be a nice headstart on incorporating this. |
How to get status code after i executed go function?
The text was updated successfully, but these errors were encountered: