There's no standard way of doing this, but you can attempt to do it anyway (although I cannot think of a reason why you would want to do this).
For totally static sites (sites that have fixed URLs to different resources), then a simple web spider will give you a pretty good indicator. You can download those from the internet so be ready to do some Googling.
For most other sites, it's not always possible to do this as most sites have dynamically generated content which is not in any way related to the number of actual pages but rather the number of different ways you can access the content.
To make things even more complicated, some sites use URLs that dont even look like web pages (servlets with cryptic URLs, or numerous parameters, or even mapped URLs that don't point to pages but dynamic content).