I found an example which uses a combination of find and xarg or exec to search a specific pattern from the result see link here.
However I'd like to use the result of find command and use it as search pattern for grep. Something like command below but am not sure how to construct it.
find . -name "*.cgi" -printf '%f\n' | cut -d. -f1 | xarg grep 'find_result' *.html