Saturday 15 June 2013

java - How to access CSS properties for a DOM node using the Cobra/Lobo HTML renderer -


itemprop = "text">

I figure out how to use CSS properties for a dome node (this example & lt; img> node) I am trying to use Cobra / Lobo Toolkit What I have at this moment:

  UserAgentContext uacontext = New SimpleUserAgentContext (); DocumentBuilderImpl Builder = New DocumentBuilderImpl (uacontext); URL url = new URL (TEST_URI); InputStream = url.openConnection (). GetInputStream (); Reader Reader = new inputstream reader (in "ISO-8859-1"); InputSourceImpl input source = new input source IMPL (reader, TEST_URI); HTMLDocumentImpl d = (HTMLDocumentImpl) Builder.pars (input source); HTML compilation images = D. gadget (); (Int i = 0; i & lt; images.getLength (); i ++) {HTMLElementImpl n = (HTMLElementImpl) images.item (i); Essence CSS 2 Properties Karr = N.GetCurst Style (); System.out.println ("Image" + i + ":" + curr.getPropertyValue ("background-color")); }  

Now it only starts giving genres set to me - not inherited or calculated style, how can I get them well?

Thanks

I hope you get the getComputedStyle Use the method.


No comments:

Post a Comment