title: Jsoup can't open html page Status=-1
body: <p>While connecting to a URL i'm getting Below is the logcat error i'm getting</p>
  
  <p>and below that my code to connect to url.</p>
  
  <p>When i try to connect to base url <a href="http://www.apkmania.co/" rel="nofollow">http://www.apkmania.co/</a> it connects successfully </p>
  
  <p>but when try to connect to this url it throws me an error.</p>
  
  <pre><code>07-31 20:47:20.150: I/System.out(14295): IOException: org.jsoup.HttpStatusException: HTTP error fetching URL. Status=404, URL=http://www.apkmania.co/2013/07/blood-sword-thd-v16-apk.html/
  </code></pre>
  
  <p>break;</p>
  
  <pre><code>Thread thread=new Thread(new Runnable(){
              public void run(){
                  PrepareItem(webrss);
                  runOnUiThread(new Runnable(){
                      public void run() {
                          if(dialog.isShowing()){ 
                              try {
                                  setDataToHandels();
                              } catch (NullPointerException e) {
                                  // TODO Auto-generated catch block
                                  e.printStackTrace();
                                  System.out.println("SET DATA TO HANDELS: " + e);
                              }
                              dialog.dismiss();
                          }
                      }
                  });
              }
          });
          thread.start(); 
  </code></pre>
  
  <p>break;</p>
  
  <pre><code>private void PrepareItem(String url) {
          System.out.println(url);
          Document content= null;
          try {
              content = Jsoup.connect(url).userAgent("Mozilla").timeout(10*1000).get();
          } catch (final IOException e) {
              // TODO Auto-generated catch block
              System.out.println("IOException: " + e.toString()); 
          }
  
          int i=0;
          try {
  
              Elements html1 = content.getElementById("main-wrapper").getElementsByTag("div").get(16).children();
              html1.select("img").first().remove();
              String[] main_content= new String[html1.size()];
              i=0;
              for (Element element_src : html1.select("div")) {
                  if (element_src.attr("dir").equals("ltr")) {
                      main_content[i] = element_src.toString();   
                      i++;
                  }               
              }
  
              for (int j = 0; j &lt; main_content.length-2; j++) {
                  all_text = all_text+main_content[j];
              }
  
              all_images_ems = html1.select("img");
              all_images_src = new String[all_images_ems.size()];
              i=0;
              for (Element img_src : all_images_ems) {
                  all_images_src[i] = img_src.attr("src");
                  i++;
              }
  
              anchor_link_ems = html1.select("a");
              all_links = new String[anchor_link_ems.size()];
              i=0;
              for (Element anchor_links : anchor_link_ems) {
                  all_links[i] = anchor_links.attr("href");
                  i++;
              }
  
          } catch (NullPointerException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
      }
  </code></pre>
  
  <p>Please help me in this regard.</p>