Results 1 to 1 of 1
  1. #1
    FunkyProg is offline Member
    Join Date
    Jan 2011
    Posts
    9
    Rep Power
    0

    Default Page source not the same : getInputStream() vs Ctrl+U

    Hi all!

    I'm using a program to access the page source of a website. I've noticed that the content is not the same as when I do it manually using Ctrl+U in the browser. Some important data are missing in the page source when I use the program, which relies on the getInputStream() method. Do you know why, and how can I fix it?

    Java Code:
    String site = "http://magasin.iga.net/Browse/All.aspx?os=1";
    
    try{
    	URL url = new URL(site);
    	URLConnection connection = url.openConnection();
    	connection.connect();
    	Scanner in = new Scanner(connection.getInputStream());
    
    	while(in.hasNextLine()){	
    
    		line = in.nextLine();
    		(print line to a file)
    									
    				}
    }
    
    catch(Exception e)
    		{
    		System.out.println(e);
    		}
    Many thanks for helping me!

    Funky
    Last edited by FunkyProg; 03-30-2011 at 07:56 AM. Reason: more accurate question

Similar Threads

  1. Get source web page after clicking next Button
    By noob in forum New To Java
    Replies: 1
    Last Post: 03-05-2010, 10:01 PM
  2. python source to java source converter?
    By conor147 in forum New To Java
    Replies: 0
    Last Post: 01-15-2010, 06:14 AM
  3. Page Source
    By fawkes in forum Networking
    Replies: 0
    Last Post: 03-24-2009, 07:06 PM
  4. Replies: 0
    Last Post: 01-29-2009, 11:43 AM
  5. Replies: 1
    Last Post: 11-28-2008, 07:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •