Yes, there are Laravel packages available that can help you collect HTML tags from an HTML page. One such package is called "PHP Simple HTML DOM Parser." This package allows you to easily parse HTML and extract specific tags and their contents.
To use this package, you can install it via Composer by running the following command in your terminal:
composer require sunra/php-simple-html-dom-parser
Once installed, you can use the following code to extract all h1 and p tags from an HTML page:
use Sunra\PhpSimple\HtmlDomParser;
// Load the HTML from a file or URL
$html = HtmlDomParser::file_get_html('http://www.example.com/');
// Find all h1 tags and print their contents
foreach($html->find('h1') as $h1) {
echo $h1->innertext . '<br>';
}
// Find all p tags and print their contents
foreach($html->find('p') as $p) {
echo $p->innertext . '<br>';
}
This code will load the HTML from a file or URL, find all h1 and p tags, and print their contents. You can modify this code to suit your specific needs.