Closed jonyt closed 7 years ago
The stack trace should be friendlier.
I'd guess it's looking for the HTML tag and it doesn't exist in the page. getPageSource basically gets the outer HTML of that element. If that's the case, the next question is why isn't the HTML element there. Not sure on that.
It's strange because when I capture the packets with tcpdump
I can see the HTML getting transferred.
You could turn on headed mode and see what it looks like. And also debug the http traffic and headers. Settings.builder().headless(false).logTrace(true).logWire(true)
Thanks, that solved it! It turns out MockWebServer doesn't set Content-Type unless told to explicitly and jBrowser doesn't like that.
I have the following test which uses
okhttp3.mockwebserver.MockWebServer
:And I get the following exception:
What element is it looking for? I can't seem to be able to trace it.