Android + Jsoup - Having problems parsing HTML [closed]

1011101

New Member
Basically, I have a large string of HTML. Inside, I have a span of class 'pageHeader'. I am having a ton of trouble just getting the app to open with the Jsoup parts added, let laone using the parsed parts of the HTML. To start, here are my imports:\[code\]import org.jsoup.Jsoup;import org.jsoup.nodes.Document;import org.jsoup.nodes.Element;import org.jsoup.select.Elements;\[/code\]After I get string \[code\]html\[/code\] which is basically just one long string of HTML, I try to parse the document in my \[code\]onCreate\[/code\] method:\[code\]try { Document doc = Jsoup.parse(html); Element span = doc.select("span.pageHeader").first(); String text = span.attr("InnerText");} catch(Exception e) { e.printStackTrace();}\[/code\]I've tried a few other things, but they're all mainly variants of that approach. It always crashes the emulator despite no viewable errors in Eclipse.
 
Top