Pass snapshot.html instead of chapter.html to countWords.