selenium icon indicating copy to clipboard operation
selenium copied to clipboard

Got content type text/html expected application/json

Open powerand opened this issue 4 years ago • 5 comments

Sometimes this error happens with our lovely selenium. We don't understand why, but this code is executed from time to time.

https://github.com/tebeka/selenium/blob/9a0798fcb455aca4de72bbe424f4bbb9cb021f53/remote.go#L163

powerand avatar Jun 19 '20 17:06 powerand

Does this happen when you use firefox? Happen to me and I found out the geckodriver does not use "http://localhost:%d/wd/hub" but "http://localhost:%d" %d is the port

inluxc avatar Feb 11 '21 11:02 inluxc

This is also happening to me, but I am using NewRemote instead of a local instance. I have ran it with Debug set to on, and it is using the correct URL. I am getting it sent to the right place, but it comes back with a 405 Method Not Allowed when I try to Submit it from the element. I am going to try to click on the button instead and see if I get a different result.

nghtstr avatar Apr 21 '21 18:04 nghtstr

I can safely confirm that by clicking on the submit button (instead of using the Submit function), it works as expected.

nghtstr avatar Apr 21 '21 18:04 nghtstr

Does this happen when you use firefox? Happen to me and I found out the geckodriver does not use "http://localhost:%d/wd/hub" but "http://localhost:%d" %d is the port

I think we should update the example so it uses correct url prefix. I hit the same issues today and fixed by following your finding.

sunshine69 avatar Sep 06 '21 00:09 sunshine69

Does this happen when you use firefox? Happen to me and I found out the geckodriver does not use "http://localhost:%d/wd/hub" but "http://localhost:%d" %d is the port

Thank You @inluxc @sunshine69 I spent all day on this, and you had the answer right here all along.
I was using NewRemote with Firefox too.

dseligson avatar Sep 26 '23 18:09 dseligson