package core;

/*
 * Copyright (c) 2002-2007 TeamDev Ltd. All rights reserved.
 *
 * Use is subject to license terms.
 *
 * The complete licence text can be found at
 * http://www.teamdev.com/winpack/license.jsf
 */

import com.jniwrapper.win32.ie.HeadlessBrowser;
import com.jniwrapper.win32.ie.WebBrowser;

/**
 * This sample creates browser without GUI. This browser doesn't require a Swing container as parent.
 *
 * @author Alexei Orischenko
 */
public class CreateHeadlessBrowserSample
{
    public static void main(String[] args)
    {
        WebBrowser browser = new HeadlessBrowser();

        browser.navigate("http://google.com");

        // Wait until page is loaded completely        
        browser.waitReady();

        String content = browser.getContent();
        System.out.println("Source of page: ");
        System.out.println(content);

        System.exit(0);
    }
}
