I'm new to Java, and want to use jsoup java library. I downloaded the jar file, and included it in my project. Next, I have a simple example, their
string html = "<"> html> gt; head & gt; title & gt; first paras & lt; / title & gt; & Lt; / head & gt; + "& lt; Body & gt; & Lt; P & gt; HTML parsed in a document & Lt; / P & gt; & Lt; / Body & gt; & Lt; / Html> "; Document Doctor = Jessop.parse (HTML); I get an error on the second line: type mismatch: javax.swing from org.jsoup.nodes.document. Can not be converted to text.Document
and offer:
Add 'cast' to change the document or type (org.jsoup.nodes Documents doc = Jsoup.parse (html);)
What's the problem? Did I forget to do something?
Check your imports at the top of your program, Regardless you are importing javax> Swing.text.Document
when you import org.jsoup.nodes.Document
Comments
Post a Comment