contender / contender
Html Contents Parser & Selector.Like a javascript.
v2.0
2023-04-01 04:06 UTC
Requires
- php: ^8.0
- ext-dom: *
- ext-libxml: *
- ext-mbstring: *
- illuminate/support: ~5.1|~6.0|~7.0|~8.0|~9.0|~10.0
- symfony/css-selector: ^6.2
Requires (Dev)
- fzaninotto/faker: ^1.5
- mockery/mockery: ^1.5
- phpunit/phpunit: ^10.0
- symfony/console: ^6.2
- symfony/debug: ^4.4
- symfony/var-dumper: ^6.2
This package is not auto-updated.
Last update: 2024-11-09 11:52:46 UTC
README
Contender is a very simple, fast, and flexible HTMLParser. You can scrape using Xpath or Css Selector.
Installation
With Composer
composer require contender/contender
<?php require 'vendor/autoload.php'; use Contender\Contender; $document = Contender::loadStr(<<<HTMLPAGE <div> <h1 id="header">Example Page</h1> <p>This is Contender example html-document.</p> </div> HTMLPAGE); $node = $document->getElementById('header'); echo $node->innerHTML; // Example Page