user9473317
user9473317

Reputation:

How use simple_html_dom in laravel

I want to use simple_html_dom in my Laravel project. but I can't add this package to my project.

How can I use simple_html_dom in laravel?

Upvotes: 3

Views: 8486

Answers (1)

Martin Heralecký
Martin Heralecký

Reputation: 5779

There are several ways, one of them using composer. Run this command from the command line:

composer require sunra/php-simple-html-dom-parser

Example usage:

use Sunra\PhpSimple\HtmlDomParser;

$document = HtmlDomParser::str_get_html($html_text);
$document->find($selector);

Upvotes: 10

Related Questions