I am having a folder with 1000 html files.
I m using linux, so how to do.
Have you tried using other tools e.g. xmlstarlet or xmllint? The latter has e.g.
--xpath "XPath_expression" Run an XPath expression given as argument and print the result. In case of a nodeset result, each node in the node set is serialized in full in the output. In case of an empty node set the "XPath set is empty" result will be shown and an error exit code will be returned.