contender/contender

Html Contents Parser & Selector.Like a javascript.

v2.0 2023-04-01 04:06 UTC

This package is not auto-updated.

Last update: 2024-11-09 11:52:46 UTC


README

CircleCI

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

Documents