This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes difference between contents of view source of a web page and url stream Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "difference between contents of view source of a web page and url stream" Watch "difference between contents of view source of a web page and url stream" New topic
Author

difference between contents of view source of a web page and url stream

nandini lagunia
Ranch Hand

Joined: May 05, 2009
Posts: 57
Hi,

I am trying to fetch the contents of a web page programmatically by using java.net.URL class. After opening the stream for the url, I am able to read the contents. I am of the opinion that this content should exactly be same as the contents of the page source.

Am I wrong? If yes, then what are the differences between those two contents?
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

You are not wrong.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
nandini lagunia
Ranch Hand

Joined: May 05, 2009
Posts: 57
Jesper de Jong wrote:You are not wrong.


Then why are the contents not equal?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60765
    
  65

Making us guess what the differences are isn't going to get you much help.



[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
nandini lagunia
Ranch Hand

Joined: May 05, 2009
Posts: 57
Bear Bibeault wrote:Making us guess what the differences are isn't going to get you much help.


lol...
Right!!!

Shall I paste both the contents?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60765
    
  65

How about just pointing out the significant differences?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: difference between contents of view source of a web page and url stream
 
Similar Threads
Interesting Problem
Problem reading in all contents of a webpage using url.openstream()
How to Retreive Meta-Tags
SocketException ?
How to read a web page.