How do you get specific tags from the_content?

Using preg_match_all() you can create a regex pattern to find and extract tags (and their content).

With WordPress’s post_content hook, you can find and list all the H1’s within current posts content with something like:

add_action('the_content', function ($content){

    // look for <h1> tags and text therein, anticipate class/id name
    $findH1s = preg_match_all('/<h1 ?.*>(.*)<\/h1>/i', $content, $h1s);

    // if found, show above content
    if (is_array($h1s) && isset($h1s[0]))   
        return "<pre>H1's in this post: ".print_r( $h1s[0] ,true)."</pre>".$content;

    // if none found, just return content as-is
    return $content;
});