Webpage size with Java

Hi.. I need to know the size in bytes of a webpage!!
For example I have this link The UNIX and Linux Forums - Learn UNIX and Linux from Experts and then...

URL u = new URL("http://www.unix.com");

There is any Java Class that can help me??

P.s.
sorry for my english... :smiley:

check the Java documentation. eg: getContentLength() method

This is the dimension of the html page! But if I have an image or a script, the dimension of the download if bigger!

You mean you want to download the embedded content of the webpage? That becomes a lot harder because it doesn't just have to download the page, it has to understand it, and recursively download the things in it as well.

Exactly... Must I do it manually? Or there is a Java Class?

you will have to parse the page and do it yourself. Remember there are many HTTP requests when loading a web page. A referenced image is not part of the first request. You could find yourself in recursion hell so be careful.

Ok... I understand... Thank you both....