Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Im using HtmlUnit as the headless browser, and it “doesn work.” Why not?

browser headless htmlunit
0
Posted

Im using HtmlUnit as the headless browser, and it “doesn work.” Why not?

0

If “doesn’t work” means that HtmlUnit does not return the snapshot you were expecting to see, it’s very likely that the culprit is that you didn’t give it enough time to execute the JavaScript and/or XHR requests. To fix this, try any or all of the following: • Use NicelyResynchronizingAjaxController. This will cause HtmlUnit to wait for any outstanding XHR calls. • Bump up the wait time for waitForBackgroundJavaScript and/or waitForBackgroundJavaScriptStartingBefore This will very likely fix your problem. If it doesn’t, you can also try the FAQ for HtmlUnit. HtmlUnit also has a user forum.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123