This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to find the size of web page

 
kishaloynag nag
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
I am able to extract the textual content as well as the image within the
page using a html parser,but now how will i find the size of the extracted text,and image..........
 
Arto Pastinen
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

Can you be little more specific?

g. Artsi
 
David Harkness
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll need to download each image referenced (and CSS and JS and any other referenced object you want to count). Some of them may tell you the size of the object in bytes at the start of the response, allowing you to get just that and then close the connection.

To find the size of the root HTML itself, simply count the characters as you read them from the stream.

If this doesn't answer your question, please post a more detailed description and -- even better -- code.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic