I would do a Producer Consumer approach (http://en.wikipedia.org/wiki/Producer-consumer_problem):
One thread queries your database (if possible through some sort of cursor so that you can do it one by one), and places each row in a buffer.
Another thread (or maybe more than one if the searching demands really much processing) is getting one row of the database (with your HTML blob) and processing the search.
In this case you can simultaneously do the querying and the processing.
I don't believe you will get much of a performance gain by the single fact that it is very likely that your querying takes far longer than the processing. The problem is that the querying part has disk reading as bottleneck. In the end your disk performance is very likely to be the one who limits your overall performance.
In order to check if it is this way, you could do the producer/consumer with more than one producer (i.e. more than one thread querying the database).
I hope it helps.
Eduardo