Download the PHP package voku/simple_html_dom without Composer

On this page you can find all versions of the php package voku/simple_html_dom. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?
voku/simple_html_dom
Rate from 1 - 5
Rated 5.00 based on 1 reviews

Informations about the package simple_html_dom

Build Status Coverage Status Codacy Badge Latest Stable Version Total Downloads License Donate to this project using Paypal Donate to this project using Patreon

:scroll: Simple Html Dom Parser for PHP

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".

Install via "composer require"

Upgrade notes for v5.0.0

Quick Start

HTML5 parsing on PHP >= 8.4: Html5DomParser

PHP 8.4 added \Dom\HTMLDocument, a parser that follows the HTML5 specification and therefore recovers from broken markup the way a browser does. This library exposes it as its own class, for the same reason PHP put it next to \DOMDocument instead of adding a mode to it: the parsing rules are different, and that difference is visible in the result.

Html5DomParser extends HtmlDomParser and has the same API, so switching means changing the class name and nothing else:

HtmlDomParser is not affected by any of this and stays the default parser of this library.

What you get with Html5DomParser: implied <tbody>, auto-closed <p> / <li> / <td>, recovery from misnested formatting tags, tag names normalized to lower case, camel-case SVG names (viewBox, feColorMatrix) restored, the encoding detected from the document like a browser does, and elements that libxml would have dropped or moved.

What is different, and why it is a separate class:

tests/Html5DomParserCompatibilityTest.php is the HtmlDomParser test suite run against Html5DomParser, so every one of these differences is pinned by a test, and everything else is proven to be unchanged.

The result is bridged back into a \DOMDocument, which costs one extra serialize + parse and more transient memory. Measure it for your own input:

On the fixtures of this repository the complete loadHtml() + query + html() round-trip is currently faster than the libxml path (factor 0.72 - 0.95), because the HTML5 parser needs none of the string preprocessing that path does; small synthetic fragments are slower (factor ~1.3 - 1.5), and peak memory is higher in both cases.

Html5DomParser is a strict parser choice. It does not silently switch back to HtmlDomParser, because that would make the class name lie about the parsing semantics. On an application that also runs on PHP < 8.4, check support before selecting the class:

Parsing throws a RuntimeException when the HTML5 backend is unavailable or when its normalized tree cannot be represented by the legacy \DOMDocument XML bridge (for example an HTML-valid attribute name that XML cannot represent). Use HtmlDomParser explicitly if legacy parsing is the intended fallback. A successful Html5DomParser parse therefore always means HTML5 tree construction actually happened.

Examples

github.com/voku/simple_html_dom/tree/master/example

API

github.com/voku/simple_html_dom/tree/master/README_API.md

Support

For support and donations please visit Github | Issues | PayPal | Patreon.

For status updates and release announcements please visit Releases | Twitter | Patreon.

For professional support please contact me.

Thanks

License

FOSSA Status


All versions of simple_html_dom with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1.0
ext-dom Version *
ext-libxml Version *
ext-simplexml Version *
symfony/css-selector Version ~3.0 || ~4.0 || ~5.0 || ~6.0 || ~7.0 || ~8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package voku/simple_html_dom contains the following files

Loading the files please wait ...