[prev in list] [next in list] [prev in thread] [next in thread] 

List:       htmlunit-user
Subject:    [Htmlunit-user]  HtmlUnit with GWT returns incomplete page
From:       Manijak <djordje1979 () yahoo ! com>
Date:       2012-09-11 19:35:29
Message-ID: 34417533.post () talk ! nabble ! com
[Download RAW message or body]


I am trying to use HtmlUnit to make HTML snapshot of my GWT application. The
idea is to make my AJAX app crawlable.

Unfortunately, the page I'm fetching doesn't seem complete. It is missing
content which is viewable when I visit the page in my normal browser. I only
need text in my html snapshot.
Here is my code:

public class Browser {

    public static void main(String[] args) throws IOException,
InterruptedException {

       final WebClient webClient = new WebClient(BrowserVersion.FIREFOX_10);
        webClient.setJavaScriptEnabled(true);//JS is enabled by default
but...
        webClient.setAjaxController(new
NicelyResynchronizingAjaxController());

        HtmlPage page = webClient.getPage("http://meridianbet.com");

        int n = webClient.waitForBackgroundJavaScript(30000);

        System.out.println("Executing " + n + " JavaSript jobs!");

        System.out.println("OUTPUT: " + page.asXml());
        webClient.closeAllWindows();
       }
}

There is still 7 unfinished JS jobs after executing code. And no metter how
long I wait that jobs ain't gonna be executed.
Any help?
-- 
View this message in context: \
http://old.nabble.com/HtmlUnit-with-GWT-returns-incomplete-page-tp34417533p34417533.html
 Sent from the HtmlUnit - General mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Htmlunit-user mailing list
Htmlunit-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/htmlunit-user


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic