Download the PHP package ioodev/elephscraper without Composer

On this page you can find all versions of the php package ioodev/elephscraper. 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?

Informations about the package elephscraper

๐Ÿ˜ ElephScraper

Packagist

ElephScraper is a lightweight, PHP-native web scraping toolkit, built on top of Guzzle and Symfony DomCrawler. This library provides a clean and powerful interface for extracting HTML, metadata, and structured data from any web page โ€” or from an HTML string you already have yourself.

Fast. Clean. Eleph-style scraping. ๐Ÿ˜โšก

Part of the ioodev scraper ecosystem alongside SnakyScraper (Python) and NodeScraper (Node.js) โ€” three libraries with a similar API philosophy for three different language ecosystems.

Moving from riodevnet/elephscraper? See Migrating from v1.0 below โ€” the namespace and package name changed in v1.1.0.


๐Ÿ“‹ Table of Contents


๐Ÿš€ Features


๐Ÿ“ฆ Installation

Install via Composer:

Requires PHP 8.0 or newer.


๐Ÿ› ๏ธ Basic Usage

Load from an HTML string (no HTTP request)

Useful for unit tests, or when you already have HTML from another source (headless browser, file cache, webhook payload, etc.):


โš ๏ธ Error Handling

By default, the constructor never throws an exception โ€” this is intentional, so a single broken URL in the middle of a batch/loop process doesn't halt the entire process. Always check one of:

If you prefer a "fail-fast" model with try/catch, set throwOnError:

All extraction methods (title(), h1(), links(), etc.) are always safe to call even if the document fails to load โ€” they will return null (never a crash), including edge cases from previous versions that had a fatal error bug under this condition.


โš™๏ธ Request Options (Headers, Timeout, Proxy, etc.)

The constructor's second parameter is an options array passed directly to Guzzle request(), merged with the defaults (timeout: 10, connect_timeout: 5, redirects followed, browser User-Agent):

You can also inject your own Guzzle Client instance (for example, for testing with a mock handler):


๐Ÿ“š Full API Reference

๐Ÿ”น Page Metadata

๐Ÿ”น Open Graph & Twitter Card

๐Ÿ”น Heading & Text

๐Ÿ”น List

๐Ÿ”น Images

๐Ÿ”น Links

๐Ÿ” Custom DOM Filter

filter() is the most flexible method โ€” ideal for scraping custom HTML structures like product lists, article cards, data tables, etc.

Filter multiple elements at once:

Get raw HTML from a single section:

Selector rules for extract:

  • Tag name: h2, p, span, etc.
  • Class: .className (automatically matches even if the element has multiple classes)
  • ID: #idName

Result array keys always follow the original selector string (e.g. result['.title']). Values in attributes (for class/id/other attributes) are safe from quote characters โ€” they won't break the selector as they could in previous versions.

Returns null if the document fails to load, or if no matching elements are found.

๐Ÿ”ง Low-Level Access

For cases not covered by the built-in methods, you can drop straight down to Symfony DomCrawler:


๐Ÿ—‚ Project Structure

This separation is intentional, to make further development easier:


๐Ÿงช Testing & Quality Tools

The test suite covers metadata extraction, heading/paragraph/list extraction, images & links (including the edge case of relative links without rel), filter() (single & multiple, including values containing quote characters), and behavior when the document fails to load (must return null, not crash).


๐Ÿ” Migrating from v1.0 (riodevnet/elephscraper)

Version 1.1.0 changes the namespace and package name following the username rename from riodevnet to ioodev. Migration steps:

Then find-and-replace throughout your project:

All method names remain exactly the same โ€” there are no signature changes to any public method that existed in v1.0, so you only need to update the use statement. See CHANGELOG.md for the full list of changes, new features, and bug fixes.


๐Ÿค Contributing

Found a bug? Want to add a feature? Open an issue or submit a pull request at github.com/ioodev/elephscraper!

Before opening a PR, please run:


๐Ÿ“ Changelog

See CHANGELOG.md for the full list of changes in each version.


๐Ÿ“„ License

MIT License ยฉ 2025โ€“2026 โ€” ioodev


๐Ÿ”— Related Libraries


๐Ÿ’ก Why ElephScraper?

ElephScraper is your trusty PHP elephant โ€” strong, smart, and always ready to extract exactly the data you need. ๐Ÿ˜


All versions of elephscraper with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
guzzlehttp/guzzle Version ^7.9
symfony/dom-crawler Version ^6.0 || ^7.0
symfony/css-selector Version ^6.0 || ^7.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 ioodev/elephscraper contains the following files

Loading the files please wait ...