title: Java - Get data from website doesn't work (403 Error)
body: <p>I'm trying to make a program that get data from <a href="http://www.pccomponentes.com/intel_core_i5_6600_3_3ghz_box.html" rel="nofollow">here</a> but an error appear (403 error)</p>
  
  <pre><code>import java.io.BufferedReader;
  import java.io.IOException;
  import java.io.InputStream;
  import java.io.InputStreamReader;
  import java.net.MalformedURLException;
  import java.net.URL;
  
  public class Test {
  
      public static void main(String[] args) throws IOException {
          URL urlObject;
          String codigo;
          try{
              urlObject=new URL("http://www.pccomponentes.com/intel_core_i5_6600_3_3ghz_box.html");
              InputStreamReader isr = new InputStreamReader(urlObject.openStream());
              BufferedReader br=new BufferedReader(isr);
              while((codigo=br.readLine())!=null)
                  System.out.println(codigo);
                  br.close();
  
          }
          catch(MalformedURLException e){
              e.printStackTrace();
          }
          catch(IOException e){
              e.printStackTrace();
          }
      }
  
  }
  </code></pre>
  
  <p>When I run the program this error appear:</p>
  
  <pre><code>java.io.IOException: Server returned HTTP response code: 403 for URL: http://www.pccomponentes.com/intel_core_i5_6600_3_3ghz_box.html
      at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
      at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
      at java.net.URL.openStream(Unknown Source)
      at Test.Test.main(Test.java:17)
  </code></pre>
  
  <p>The purpose of the program it's get the price of the product and print it with a System.out.println, how can I do that?</p>