php-simple-html-dom-parser
php-simple-html-dom-parser copied to clipboard
Not compatible with php 7.3
PHP Warning 'yii\base\ErrorException' with message 'preg_match(): Compilation failed: invalid range in character class at offset 4'
in .../sunra/php-simple-html-dom-parser/Src/Sunra/PhpSimple/simplehtmldom_1_5/simple_html_dom.php:1378
https://github.com/sunra/php-simple-html-dom-parser/blob/master/Src/Sunra/PhpSimple/simplehtmldom_1_5/simple_html_dom.php#L1378
I got the same error
php 7.3 has some bugs in preg_* function
@wotupset Not bugs. PHP 7.3 has updated its regular expression engine to PCRE2, which brings some breaking changes.
I think the dash in referenced expression needs to be escaped.
More: http://php.net/manual/en/migration73.other-changes.php#migration73.other-changes.pcre
There's even a PR opened two months ago that fixes this: #63 but it's left unmerged. This package might be abandoned.
7.3 compatible version: https://github.com/Kub-AT/php-simple-html-dom-parser
Author of original PHP Simple HTML DOM Parser (sourceforge hosted) did an update on 2018-12-10 (after 6 year ;)) version 1.7 is compatible with PHP 7.3 https://sourceforge.net/projects/simplehtmldom/files/simplehtmldom/1.7/
careful with 1.8.1 which is the version used by https://github.com/Kub-AT/php-simple-html-dom-parser
This version doesn't work as expected for example:
$dom->find('div[class=name]', 0);
The above fails if the div has more than 1 class. I'm currently working with version 1.7.1 which doesn't have this issue.
careful with 1.8.1 which is the version used by https://github.com/Kub-AT/php-simple-html-dom-parser
This version doesn't work as expected for example:
$dom->find('div[class=name]', 0);
The above fails if the div has more than 1 class. I'm currently working with version 1.7.1 which doesn't have this issue.
It would be nice if you reported a bug here https://sourceforge.net/p/simplehtmldom/bugs/
careful with 1.8.1 which is the version used by https://github.com/Kub-AT/php-simple-html-dom-parser This version doesn't work as expected for example:
$dom->find('div[class=name]', 0);
The above fails if the div has more than 1 class. I'm currently working with version 1.7.1 which doesn't have this issue.It would be nice if you reported a bug here https://sourceforge.net/p/simplehtmldom/bugs/
Thanks m8, I've opened an bug issue: https://sourceforge.net/p/simplehtmldom/bugs/169/
I'll include more details to it as soon as I get a chance 👍
7.3 compatible version: https://github.com/Kub-AT/php-simple-html-dom-parser
Author of original PHP Simple HTML DOM Parser (sourceforge hosted) did an update on 2018-12-10 (after 6 year ;)) version 1.7 is compatible with PHP 7.3 https://sourceforge.net/projects/simplehtmldom/files/simplehtmldom/1.7/
hi use this https://github.com/Kub-AT/php-simple-html-dom-parser
but i get error Message: Call to undefined method KubAT\PhpSimple\HtmlDomParser::loadFromUrl()
@Kub-AT
7.3 compatible version: https://github.com/Kub-AT/php-simple-html-dom-parser Author of original PHP Simple HTML DOM Parser (sourceforge hosted) did an update on 2018-12-10 (after 6 year ;)) version 1.7 is compatible with PHP 7.3 https://sourceforge.net/projects/simplehtmldom/files/simplehtmldom/1.7/
hi use this https://github.com/Kub-AT/php-simple-html-dom-parser
but i get error Message: Call to undefined method KubAT\PhpSimple\HtmlDomParser::loadFromUrl()
@Kub-AT
it looks like you have mistaken the library, there is no loadFromUrl in simplehtmldom but is in https://github.com/paquettg/php-html-parser
this should be reported in the composer.yml
file ! to avoid installation under >= php7.3
(php 7.4 is RC1 now)
@vistart, Get the last version of simplehtmldom from "https://sourceforge.net/projects/simplehtmldom/files/simplehtmldom/1.9.1/" site. It will work.
@vistart, Get the last version of simplehtmldom from "https://sourceforge.net/projects/simplehtmldom/files/simplehtmldom/1.9.1/" site. It will work.
Thanks this works like charm +1
@vistart, Get the last version of simplehtmldom from "https://sourceforge.net/projects/simplehtmldom/files/simplehtmldom/1.9.1/" site. It will work.
Thank you, it worked for me too.
7.3 compatible version: https://github.com/Kub-AT/php-simple-html-dom-parser
Author of original PHP Simple HTML DOM Parser (sourceforge hosted) did an update on 2018-12-10 (after 6 year ;)) version 1.7 is compatible with PHP 7.3 https://sourceforge.net/projects/simplehtmldom/files/simplehtmldom/1.7/
How can we install the 1.7 version of the original parser? I'm using laravel and the listed package doesn't contain a composer.json file
@serg1uu I found an alternative, go for https://github.com/simplehtmldom/simplehtmldom