0

i am using htmlunit to try to open a site but I keep getting 404 errors. The site works in my python scripts and in my browser but not in html unit for some reason. I think my URL itself is fine but it seems to be opening another site within the site and failing (example.com/SharedResources/Default/js/coda_bubble/jquery.codabubble.js)

For anyone familiar with htmlunit, is there any way to get it not to automatically load these other areas of the site? or more gracefully handle errors on the site?

Thanks so much in advance.

1 Answer 1

3

ok sorry for posting without researching very heavy. I couldn't figure it out and a savy programming friend pointed me to the api and to stop this error I had to put:

webclient.setThrowExceptionOnFailingStatusCode(False)

I had some problems at first but after I capitalized the F in False, it worked out. Shows how new I am to programming.

Thanks everyone and I hope it helps!

Sign up to request clarification or add additional context in comments.

1 Comment

The method setThrowExceptionOnFailingStatusCode is part of the class WebClientOptions. Use webclient.getOptions().setThrowExceptionOnFailingStatusCode(false); to set this option.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.