title: Fetching body text from a URL
body: <p>I want to read a URL and get the body content to a string. See below code. It is returning an error as 'fail to connect '10.10.10.23'. But I can see that url in browser without any problem. Could anyone help?</p>
  
  <pre><code>class MyTask extends AsyncTask&lt;Void, Void, String&gt; {
  
      @Override
      protected String doInBackground(Void... params) {
          String title ="";
          //Document doc;
          try {
  
  
              URL url = new URL("http://10.10.10.23/Test/TestVersion.aspx");
              org.jsoup.nodes.Document doc = Jsoup.parse(url, 3 * 1000);
  
              String text = doc.body().text();
  
              System.out.println(text); // outputs 1
          }
          catch (Exception e)
          {
              e.getStackTrace();
          }
          return title;
      }
  
  
      @Override
      protected void onPostExecute(String result) {
          //if you had a ui element, you could display the title
          //((TextView)findViewById (R.id.myTextView)).setText (result);
      }
  }
  </code></pre>