2013-11-27 56 views

回答

3

嘗試使用以下內容:

WebClient webClient = new WebClient(); 
    XHtmlPage page = webClient.getPage("…"); 
    HtmlElement div = page.getHtmlElementById("elem_container"); 
    WebWindow window = webClient.getCurrentWindow(); 
    Window jscript = (Window) window.getScriptObject(); 
    HTMLElement element = (HTMLElement) jscript.makeScriptableFor(div); 
    ComputedCSSStyleDeclaration style = jscript.jsxFunction_getComputedStyle(element, null); 
    System.out.println(style);