Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to know if it's possible to use wget to wordcount an entire website.

Has anyone already tried that?

This is what I have found so far:

wget -q -O- | grep -c .
share|improve this question
You mean actual word count? or do you want to count also the meta-words such as tags, attributes, titles etc? – M'vy Apr 11 '11 at 14:56
yes just the content – mnml Apr 11 '11 at 14:59
Then you need to have an HTML parser that can process input from stdin. Don't know any ATM. – M'vy Apr 11 '11 at 15:09
up vote 1 down vote accepted

wget -q -r -O- | wc -l

But if the site is not static, has password protected areas or contains forms, you are not going to be able to retrieve all of it easily.

If you need to count all the words on, say Amazon, you might need to top up the credit card associated with your one-click account :-)

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .