title: Jsoup.connect Throws error
body: <p>I want to parse html pages and extract data but when I tried to connect with Jsoup it throws errors.
  when I connected using httpclient  [String s = EntityUtils.toString(response.getEntity(), "UTF-8");]
  there was no problem  the html page content I was able to store into a string. But with Jsoup I am not able to do it.Am I making some error?</p>
  
  <pre><code>    package com.example.flashcardsdemo;
  
  import java.io.InputStream;
  
  import org.apache.http.HttpResponse;
  import org.apache.http.StatusLine;
  import org.apache.http.client.HttpClient;
  import org.apache.http.client.methods.HttpGet;
  import org.apache.http.impl.client.DefaultHttpClient;
  import org.jsoup.Jsoup;
  import org.jsoup.nodes.Document;
  import org.w3c.dom.Element;
  
  //import com.example.flashcards.MainActivity.Gethtml;
  
  import android.app.Activity;
  import android.app.ProgressDialog;
  import android.content.Context;
  import android.os.AsyncTask;
  import android.os.Bundle;
  import android.util.Log;
  import android.view.Menu;
  import android.view.MenuItem;
  
  public class MainActivity extends Activity {
  
      Context context;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          context=this;
          Gethtml Ght = new Gethtml();
          Ght.execute();
      }
  
      public class Gethtml extends AsyncTask {
          ProgressDialog dialog;
          String UrlLink = "http://en.wikipedia.org/";
          @Override
          protected void onPreExecute() {
              // TODO Auto-generated method stub
              super.onPreExecute();
              dialog = new ProgressDialog(context);
              dialog.setTitle("Loading");
              dialog.setMessage("Html....");
              dialog.show();
          }
  
          @Override
          protected Object doInBackground(Object... params) {
              try {
                  HttpClient client = new DefaultHttpClient();
                  HttpGet request = new HttpGet(UrlLink);
                  HttpResponse response = client.execute(request);
                  StatusLine line = response.getStatusLine();
                  int statuscode = line.getStatusCode();
                  if (statuscode != 200) {
                      return null;
                  }
  
                  Document doc  = Jsoup.connect(UrlLink).get();
  
              }
  
              catch (Exception e) {
                  Log.v("Error", e.toString());
              }
  
              return null;
          }
  
  
  
          @Override
          protected void onPostExecute(Object result) {
              dialog.dismiss();
  
          }
      }   
  }
  </code></pre>
  
  <p>LogCat image:
        [1]: <a href="http://i.stack.imgur.com/Q6bDv.png" rel="nofollow">http://i.stack.imgur.com/Q6bDv.png</a>
        [2]: <a href="http://i.stack.imgur.com/TBxUB.png" rel="nofollow">http://i.stack.imgur.com/TBxUB.png</a></p>