title: How to get a web page's source code from Java
body: <p>I just want to retrieve any web page's source code from Java. I found lots of solutions so far, but I couldn't find any code that works for all the links below: </p>
  
  <ul>
  <li><a href="http://www.cumhuriyet.com.tr?hn=298710" rel="noreferrer">http://www.cumhuriyet.com.tr?hn=298710</a></li>
  <li><a href="http://www.fotomac.com.tr/Yazarlar/Olcay%20%C3%87ak%C4%B1r/2011/11/23/hesap-makinesi" rel="noreferrer">http://www.fotomac.com.tr/Yazarlar/Olcay%20%C3%87ak%C4%B1r/2011/11/23/hesap-makinesi</a> </li>
  <li><a href="http://www.sabah.com.tr/Gundem/2011/12/23/basbakan-konferansta-konusuyor#" rel="noreferrer">http://www.sabah.com.tr/Gundem/2011/12/23/basbakan-konferansta-konusuyor#</a></li>
  </ul>
  
  <p>The main problem for me is that some codes retrieve web page source code, but with missing ones. For example the code below does not work for the first link.</p>
  
  <pre><code>InputStream is = fURL.openStream(); //fURL can be one of the links above
  BufferedReader buffer = null;
  buffer = new BufferedReader(new InputStreamReader(is, "iso-8859-9"));
  
  int byteRead;
  while ((byteRead = buffer.read()) != -1) {
      builder.append((char) byteRead);
  }
  buffer.close();
  System.out.println(builder.toString());
  </code></pre>