paquettg / php-html-parser

An HTML DOM parser. It allows you to manipulate HTML. Find tags on an HTML page with selectors just like jQuery.
MIT License
2.36k stars 460 forks source link

Too few arguments to function PHPHtmlParser\Dom::loadStr(), 1 passed and exactly 2 expected #301

Open Serzol64 opened 2 years ago

Serzol64 commented 2 years ago

All the good time of day

I like your library.0 but the point of the question is that following the instructions in your README.mdie isn ' t exactly library .

$curA->content - is the operating parameter of the HTML code .

How to run the right method without any parameters after the content , as in the basic parts of the documentation , the same settings that are missing for the library 's complete work?

Thank you very much!

diegoBSousa commented 2 years ago

Try on adding a second parameter:

     $options = [];
     $contentQuery = (new Dom)->loadStr($curA->content, $options);

Because loadStr has this signature: public function loadStr(string $str, ?Options $options = null): Dom https://github.com/paquettg/php-html-parser#options