看到结果HttpUnitOptions.setLoggingHttpHeaders(true); HttpUnit 项目内部?
我的目标是能够使用 HttpUnit 爬行我的网页并查看后台正在触发和未触发的内容...我已经让它连接到我的页面,并且如果我设置
HttpUnitOptions.setLoggingHttpHeaders(true);
我看到了我关心的各种后台调用。但是,我不知道如何查看程序内的这些交互。 WebResponse 对象的大多数 getText 和 getInputStream 调用似乎只是 HTML 调用,并且不会记录在后台触发的各种 javascript 调用。有没有办法获得后台发生的所有事情的列表? HttpUnit 的文档似乎很少。
谢谢!
My goal is to be able to use HttpUnit to crawl around my webpage and see what is and is not firing in the background... I have gotten it to connect to my page, and if I set
HttpUnitOptions.setLoggingHttpHeaders(true);
I see the sorts of background calls that I care about. However, I do not know how to see those interactions within the program. most of the getText and getInputStream calls fo the WebResponse object seem to just be the HTML call, and don't log the various javascript calls that fire in the background. Is there a way to get a list of all of the things going on in the background? HttpUnit's documentation seems sparse.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我只是偶然发现了答案。看起来您需要创建一个实现 WebClientListener 的类,然后调用 wc.addClientListener(new YourListener());其中 wc 是 WebClient。
我不会删除它,以便其他人可以看到......也许还有比这更多的细微差别。
I just stumbled upon the answer. it looks like you need to make a class that implements WebClientListener, and then call wc.addClientListener(new YourListener()); where wc is a WebClient.
I don't delete this so others can see...and perhaps there is more nuance to it than that.