Validating all php generated html code?


Hello ruby team.
I got a new interesting assignment, to validate all html code of all our
products. Doing this manual would take me a very long time. Thus I seek
automated solution and wonder if anybody has done something similar?
Here is
what I think needs to be done:

  1. Generate each html page possible (the html code is created by MySQL
    php scripts). It would be great to have a web crawler clicking each link
    the web-site and saving the generated html-file.
  2. Validating all the html files
    Has anybody done something like this? Any ideas regarding what tools to
    Any recommendations, ideas, etc?
    Thanks for your help.