sanzodown/simple-php-crawler

A simple crawler written in PHP.

dev-master 2021-03-24 18:53 UTC

This package is not auto-updated.

Last update: 2024-10-03 11:11:43 UTC


README

A simple crawler library for php using DOMDocument. For educational purpose.

Installation

composer require sanzodown/simple-php-crawler

Usage

$crawler = new Crawler("https://www.domain.com/");

// if u need to be authentificated
$crawler->setLogin("username","password");

Methods:

//return an array of the DOMNode
$result = $crawler->filter(".header-logo > a");

//some lazy methods
$imgs = $crawler->getAllImages();
$links = $crawler->getAllLinks();