No need to write a shell script, simply use find command. In this example, list all *.html files stored in /path/to/dir:
To delete simply add -delete
find /path/to/dir -iname "*.html"
Set a cron job and clean out required files. If you want to delete them daily then create a file called /etc/cron.daily/cleanhtmlfiles:
find /path/to/dir -iname "*.html" -delete
Set executable permission and you are done!
# Task: Clean html files
# add your find command here
find /dir1 -iname "*.html" -delete
find /dir2 -iname "*.html" -delete