-
-
Notifications
You must be signed in to change notification settings - Fork 181
Description
I successfull done login with HtmlUnit on SITE, run a form search and got a page with results. Now in real world, to get the whole page result I need to scroll the page more times . But I am using HtmlUnit ,then I have done :
List
ScriptResult res=page.executeJavaScript("window.scrollBy (0,2000);");
res=page.getByXPath(...) // would get more items than 13 items
But the 2nd XPath query return same result items as the first . Instead ,on browser, the scroll work well and return the second train of result items 8MORE THAN 13). Then , does HtmlUnit is not designed for this ? a bug ? or there is another HtmlUnit trick?
I tried also
ScriptResult res =page.getBody().fireEvent("scroll");
..But even this work .
Finally , I thought , if HtmlUnit can't manage Scroll Event
maybe is possible to fire the JS code fired by Scroll Event , in this way I can bypass the scroll event and obtaining his result .
But , does HtmlUnit can make an Ajax request ? How ?
thanks