Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 HtmlUnit 加载一个充满 JavaScript 的网页。执行WebClientJavaScript 就好了。
WebClient
但是,当我单击调用 Ajax 调用的特定表单上的按钮时,即使调用本身完成,内容(结果)也不会出现在页面上(即使它出现在真正的浏览器中)。
HtmlPage为什么单击按钮后不包含动态添加的内容?
HtmlPage
有没有办法在 HtmlUnit 中获取“更新”页面?
首先您必须等待 AJAX 调用完成,然后需要在 Ajax 调用后同步您的页面,
synchronized (your_page);