htmlunit 404 error for scripts within page

一笑奈何 提交于 2019-12-25 03:21:05

问题


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:


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!



来源:https://stackoverflow.com/questions/5240221/htmlunit-404-error-for-scripts-within-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!