php-simple-html-dom-parser icon indicating copy to clipboard operation
php-simple-html-dom-parser copied to clipboard

Maintained Fork of PHP Simple HTML DOM Parser (PHP 7.X)

Open voku opened this issue 4 years ago • 1 comments

https://github.com/voku/simple_html_dom


A HTML DOM parser written in PHP - let you manipulate HTML in a very easy way! This is a fork of PHP Simple HTML DOM Parser project but instead of string manipulation we use DOMDocument and modern php classes like "Symfony CssSelector".

  • PHP 7.0+ Support
  • PHP-FIG Standard
  • Composer & PSR-4 support
  • PHPUnit testing via Travis CI
  • PHP-Quality testing via SensioLabsInsight
  • UTF-8 Support (more support via "voku/portable-utf8")
  • Invalid HTML Support (partly ...)
  • Find tags on an HTML page with selectors just like jQuery
  • Extract contents from HTML in a single line

voku avatar Nov 21 '19 02:11 voku

However, I think there should be made some caveats about migration. In the fork:

  • Method find wouldn't return [] if nothing found. Consider replacing by findOneOrFalse or findMultyOrFalse in your code
  • Method find wouldn't return array, so you can't use methods like array_pop on it's result
  • There in no attr property, replace it by getAttribute in your code
  • Not all of the JQuery selectors are supported, i.e. there is no :gt(), I think others are missing too

This is the list, that we have faced during the migration

malsatin avatar Dec 07 '20 01:12 malsatin