Skip to content
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

Open
alehatsman opened this issue Jan 22, 2018 · 7 comments
Open

How to get status code. #98

alehatsman opened this issue Jan 22, 2018 · 7 comments
Labels

Comments

@alehatsman
Copy link
Contributor

How to get status code after i executed go function?

@igrishaev
Copy link
Collaborator

@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 capabilities value. The issue you've created is to process log-type key.

@marceloramires
Copy link

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.

@lotuc
Copy link

lotuc commented Nov 21, 2022

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 etaoin.dev/get-requests result? Maybe enable this behavior via some experimental option?

@lread
Copy link
Collaborator

lread commented Nov 21, 2022

Thanks for the comment @lotuc!

I'll re-open this issue so we don't forget about it.

@lread lread reopened this Nov 21, 2022
@lread
Copy link
Collaborator

lread commented Dec 2, 2022

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.

@lread lread added the docs label Dec 2, 2022
@lotuc
Copy link

lotuc commented Dec 4, 2022

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

@lread
Copy link
Collaborator

lread commented Dec 4, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants