Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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- http://www.website.com | 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
add comment

1 Answer

up vote 1 down vote accepted

wget -q -r -O- http://www.example.com | 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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.