How to extract text and images from html?
<p>I am using this to extract SPAN tags and tell how many there is.</p>

<pre><code>ublic class HtmlparserExampleActivity extends Activity {
String outputtext;
  TagFindingVisitor visitor;
  Parser parser = null;
private static final String TAG = "TVGuide";

private static final boolean D = true;

TextView outputTextView;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);




     outputTextView = (TextView) findViewById(R.id.outputTextView);


    if(D) Log.e(TAG, "+++ ON CREATE +++");


    try {
        Log.e(TAG, "In doInBackground");

        parser = new Parser ("http://www.johandegraeve.net/android");

            String tags[] = { "SPAN" };

          visitor = new TagFindingVisitor(tags);

            try {

                parser.visitAllNodesWith (visitor);

                outputtext =  "there are " + visitor.getTags(0).length + " SPAN nodes.\n";

                for (int i = 0;i&lt;visitor.getTags(0).length;i++) {

                    outputtext = outputtext + visitor.getTags(0)[i].toHtml();  


                }

              outputTextView.setText(outputtext);

            } catch (ParserException e) {

                if(D) Log.e(TAG, "Exception in +++ ON CREATE +++ \n" +

                        "parser.visitAllNodesWith (visitor) failed\n" +

                        e.toString());

            }

    } catch (ParserException e1) {

        if(D) Log.e(TAG, "Exception in +++ ON CREATE +++ \n" +

                "creation of parser failed\n" +

                e1.toString());
</code></pre>

<p>}
        }</p>

<p>}</p>

<p>How do i change this to get the text and images and display just the text and images in their wigdets? Using this code?</p>

<p>EDIT: What would be the tags for a html page like this to get the text and the images URLs?</p>

<p><a href="http://movies.ign.com/articles/100/1002569p1.html" rel="nofollow">http://movies.ign.com/articles/100/1002569p1.html</a></p>

<p>EDIt: Source code.</p>

<pre><code>public class HtmlparserExampleActivity extends Activity {
String outputtext;
  TagFindingVisitor visitor;
  Parser parser = null;
private static final String TAG = "TVGuide";



TextView outputTextView;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    outputTextView = (TextView)findViewById(R.id.outputTextView);
    String id = "main-article-content";
    Document doc = null;

    try {
        doc = Jsoup.connect("http://movies.ign.com/articles/100/1002569p1.html").get();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

    Log.i("DOC", doc.toString().toString());
    Elements elementsHtml = doc.getElementsByTag(id);  
    String[] temp1 = new String[99];;
    int i =0;
    for(Element element: elementsHtml)
    {

        temp1 = element.text();
        i++;
        outputTextView.setText(temp1[1]);

    }




}
</code></pre>

<p>}</p>

<p>I tried this, it didnt work. Maybe im doing something wrong. NO text showed up in the textview. But i seen some tags in the debug from the webpage. </p>
