PHPackages                             lenonleite/simple-crawler - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. lenonleite/simple-crawler

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

lenonleite/simple-crawler
=========================

LenonLeite Component - Simple Crawler, for read pages

v0.4(8y ago)141092MITPHPPHP &gt;=7.0.0

Since Aug 1Pushed 7y ago5 watchersCompare

[ Source](https://github.com/lenonleite/simple-crawler)[ Packagist](https://packagist.org/packages/lenonleite/simple-crawler)[ Docs](http://www.lenonleite.com.br)[ RSS](/packages/lenonleite-simple-crawler/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (4)DependenciesVersions (6)Used By (0)

Single Crawler
==============

[](#single-crawler)

> Single Crawler is a single method of crawller sites.

Beta Version
------------

[](#beta-version)

> 0.4

New Features
------------

[](#new-features)

- PHP / Methods
- Html
- Form

Usage
-----

[](#usage)

> #### Get Tags In Html
>
> [](#get-tags-in-html)

```
use Lenonleite\SimpleCrawler;
$html = file_get_contents( 'teste.html' );
$general = new SimpleCrawler\General();
$result = $general->get_tags('div', $html );
```

*Result*

```
array(4) {
  [0]=>
  string(29) ""
  [1]=>
  string(18) ""
  [2]=>
  string(32) ""
  [3]=>
  string(17) ""
}
```

> #### General Get Atribute Tag
>
> [](#general-get-atribute-tag)

```
use Lenonleite\SimpleCrawler;
$html = '';
$general = new SimpleCrawler\General();
$result = $general->get_atribute_tag( $html );
```

*Result*

```
array(3) {
  ["full"]=>
  string(29) ""
  ["key"]=>
  string(3) "div"
  ["value"]=>
  string(23) "id="header" class="all""
}
```

> #### General Get Atribute Tag In Array
>
> [](#general-get-atribute-tag-in-array)

```
use Lenonleite\SimpleCrawler;
$html[] = '';
$html[] = '';
$general = new SimpleCrawler\General();
$result = $general->get_attributes_array_tags( $html );
```

*Result*

```
array(2) {
  [0]=>
  array(3) {
    ["full"]=>
    string(29) ""
    ["key"]=>
    string(3) "div"
    ["value"]=>
    string(23) "id="header" class="all""
  }
  [1]=>
  array(3) {
    ["full"]=>
    string(18) ""
    ["key"]=>
    string(3) "div"
    ["value"]=>
    string(12) "id="content""
  }
}
```

> #### General Get Atribute Tag In Array
>
> [](#general-get-atribute-tag-in-array-1)

```
use Lenonleite\SimpleCrawler;
$html = file_get_contents( 'teste.html' );
$general = new SimpleCrawler\General();
$result = $general->get_data_tags( 'div', $html );
```

*Result*

```
array(3) {
  ["tags"]=>
  array(4) {
    [0]=>
    string(29) ""
    [1]=>
    string(18) ""
    [2]=>
    string(32) ""
    [3]=>
    string(17) ""
  }
 ["html"]=>
   string(322) "..."
 ["tags_atributes"]=>
   array(4) {
     [0]=>
     array(3) {
       ["full"]=>
       string(29) ""
       ["key"]=>
       string(3) "div"
       ["value"]=>
       string(23) "id="header" class="all""
     }
     [1]=>
     array(3) {
       ["full"]=>
       string(18) ""
       ["key"]=>
       string(3) "div"
       ["value"]=>
       string(12) "id="content""
     }
     [2]=>
     array(3) {
       ["full"]=>
       string(32) ""
       ["key"]=>
       string(3) "div"
       ["value"]=>
       string(26) "id="sidebar" class="right""
     }
     [3]=>
     array(3) {
       ["full"]=>
       string(17) ""
       ["key"]=>
       string(3) "div"
       ["value"]=>
       string(11) "id='footer'"
     }
   }
 }
```

> #### General Get Html betwenn Tags By Tag/Attribute/Value
>
> [](#general-get-html-betwenn-tags-by-tagattributevalue)

```
use Lenonleite\SimpleCrawler;
$html = file_get_contents( 'teste.html' );
$general = new SimpleCrawler\General();
$tag       = 'div';
$attribute = 'id';
$value     = 'sidebar';
$result = $general->get_html_between_tag_attr_and_value( $html, $tag, $attribute, $value );
```

*Result*

```
array(1) {
  [0]=>
  string(51) "
    Sidebar
"
}
```

> #### General Get Html betwenn Tags By Tag/Value Id or Class
>
> [](#general-get-html-betwenn-tags-by-tagvalue-id-or-class)

```
use Lenonleite\SimpleCrawler;
$html = file_get_contents( 'teste.html' );
$general = new SimpleCrawler\General();
$tag    = 'div';
$value  = 'internal';
$result = $general->get_html_between_tag_attr_and_value( $html, $tag, $value );
```

*Result*

```
array(2) {
  [0]=>
  string(64) "
    Title
"
  [1]=>
  string(60) "
    Sidebar
"
}
```

> #### General Get Html betwenn Tags By Tag
>
> [](#general-get-html-betwenn-tags-by-tag)

```
use Lenonleite\SimpleCrawler;
$html = file_get_contents( 'teste.html' );
$general = new SimpleCrawler\General();
$tag    = 'div';
$result = $general->get_html_between_tag( $html, $tag );
```

*Result*

```
array(4) {
  [0]=>
  string(64) "
    Title
"
  [1]=>
  string(51) "
     Center right
"
  [2]=>
  string(60) "
    Sidebar
"
  [3]=>
  string(25) "

"
}
```

> #### General Get html between tag by tag and class or id
>
> [](#general-get-html-between-tag-by-tag-and-class-or-id)

```
use Lenonleite\SimpleCrawler;
$html = file_get_contents( 'teste.html' );
$general = new SimpleCrawler\General();
$tag = 'div';
$name_class_or_id = 'sidebar';
$result = $general->get_html_between_tag_attr_id_or_class( $html, $tag, $name_class_or_id );
```

*Result*

```
array(1) {
  [0]=>
  string(60) "
    Sidebar
"
```

> #### General Get on parts os structure tags
>
> [](#general-get-on-parts-os-structure-tags)

```
use Lenonleite\SimpleCrawler;
$general = new SimpleCrawler\General();
$tag = '';
$result = $general->get_attribute_tag( $tag );
```

*Result*

```
array(3) {
  ["full"]=>
  string(29) ""
  ["key"]=>
  string(3) "div"
  ["value"]=>
  string(23) "id="header" class="all""
}
```

> #### PHP / Methods Get data of Methods on Html.
>
> [](#php--methods-get-data-of-methods-on-html)

```
use Lenonleite\SimpleCrawler;
$html_php = file_get_contents( 'teste_php_methods.html' );
$php = new SimpleCrawler\Php\Methods();
$result = $php->get_parameters( $html_php );
```

*Result*

```
array(3) {
  [0]=>
  array(6) {
    ["type_methdd"]=>
    string(6) "public"
    ["static"]=>
    string(0) ""
    ["name_method"]=>
    string(6) " error"
    ["atributes"]=>
    array(1) {
      [0]=>
      string(8) "$message"
    }
    ["internal_context"]=>
    string(87) "
$this->CleanUp();
if (!isset($this->info['error'])) {
$this->info['error'] = array();
"
    ["all_context"]=>
    string(121) "public function error($message) {
$this->CleanUp();
if (!isset($this->info['error'])) {
$this->info['error'] = array();
}"
  }
  [1]=>
  array(6) {
    ["type_methdd"]=>
    string(0) ""
    ["static"]=>
    string(0) ""
    ["name_method"]=>
    string(8) " warning"
    ["atributes"]=>
    array(1) {
      [0]=>
      string(8) "$message"
    }
    ["internal_context"]=>
    string(51) "
$this->info['warning'][] = $message;
return true;
"
    ["all_context"]=>
    string(81) "
function warning($message) {
$this->info['warning'][] = $message;
return true;
}"
  }
  [2]=>
  array(6) {
    ["type_methdd"]=>
    string(7) "private"
    ["static"]=>
    string(7) "static "
    ["name_method"]=>
    string(8) " warning"
    ["atributes"]=>
    array(2) {
      [0]=>
      string(8) "$message"
      [1]=>
      string(6) "$error"
    }
    ["internal_context"]=>
    string(51) "
$this->info['warning'][] = $message;
return true;
"
    ["all_context"]=>
    string(102) "private static function warning($message,$error) {
$this->info['warning'][] = $message;
return true;
}"
  }
}
```

> #### HTML Get all urls on Html.
>
> [](#html-get-all-urls-on-html)

```
use Lenonleite\SimpleCrawler;
$html_txt = 'Visit W3Schools';
$html = new SimpleCrawler\Html();
$result = $html->get_parameters( $html_txt );
```

*Result*

```
array(1) {
  [0]=>
  string(25) "https://www.w3schools.com"
}
```

> #### LOGIN Get data about forms.
>
> [](#login-get-data-about-forms)

```
use Lenonleite\SimpleCrawler;
$html = file_get_contents( 'teste.html' );
$login = new SimpleCrawler\Login();
$result = $login->get_forms( $html );
```

*Result*

```
array(1) {
  [0]=>
  array(3) {
    ["html"]=>
    string(280) "
        First name:

        Last name:

    "
    ["fields"]=>
    array(2) {
      ["tags"]=>
      array(3) {
        [0]=>
        string(55) ""
        [1]=>
        string(57) ""
        [2]=>
        string(36) ""
      }
      ["tags_atributes"]=>
      array(3) {
        [0]=>
        array(3) {
          ["full"]=>
          string(51) ""
          ["key"]=>
          string(5) "input"
          ["value"]=>
          string(43) "type="text" name="firstname" value="Mickey""
        }
        [1]=>
        array(3) {
          ["full"]=>
          string(49) ""
          ["key"]=>
          string(5) "input"
          ["value"]=>
          string(41) "type="text" name="lastname" value="Mouse""
        }
        [2]=>
        array(3) {
          ["full"]=>
          string(36) ""
          ["key"]=>
          string(5) "input"
          ["value"]=>
          string(28) "type="submit" value="Submit""
        }
      }
    }
    ["form"]=>
    array(2) {
      ["tags"]=>
      array(1) {
        [0]=>
        string(46) ""
      }
      ["tags_atributes"]=>
      array(1) {
        [0]=>
        array(3) {
          ["full"]=>
          string(46) ""
          ["key"]=>
          string(4) "form"
          ["value"]=>
          string(39) "action="/action_page.php" method="POST""
        }
      }
    }
  }
}
```

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 91.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~35 days

Total

4

Last Release

3148d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/218436?v=4)[Lenon Leite](/maintainers/lenonleite)[@lenonleite](https://github.com/lenonleite)

---

Top Contributors

[![lenonleite](https://avatars.githubusercontent.com/u/218436?v=4)](https://github.com/lenonleite "lenonleite (21 commits)")[![leonnleite](https://avatars.githubusercontent.com/u/1596192?v=4)](https://github.com/leonnleite "leonnleite (2 commits)")

---

Tags

phpwordpresslibrarycrawlerreadbodyHackinghackerpentest

### Embed Badge

![Health badge](/badges/lenonleite-simple-crawler/health.svg)

```
[![Health](https://phpackages.com/badges/lenonleite-simple-crawler/health.svg)](https://phpackages.com/packages/lenonleite-simple-crawler)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
