PHPackages                             balpom/links-extractor - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. balpom/links-extractor

ActiveLibrary[HTTP &amp; Networking](/categories/http)

balpom/links-extractor
======================

Extract all links from string in extended PSR-13 format.

v1.1.2(1y ago)017MITPHPPHP &gt;=8.1

Since May 23Pushed 1y ago1 watchersCompare

[ Source](https://github.com/balpom/links-extractor)[ Packagist](https://packagist.org/packages/balpom/links-extractor)[ Docs](https://www.balpom.ru)[ RSS](/packages/balpom-links-extractor/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (3)Versions (5)Used By (0)

balpom/links-extractor
======================

[](#balpomlinks-extractor)

Extract all links from string and provide it in extended PSR-13 format.
-----------------------------------------------------------------------

[](#extract-all-links-from-string-and-provide-it-in-extended-psr-13-format)

This extractor extract all HTTP links from given string (or [PSR-7 Response](https://www.php-fig.org/psr/psr-7/) object) and provide it in [Balpom\\WebLink\\EvolvableWebLinkInterface](https://github.com/balpom/web-link) format (which extends Psr\\Link\\EvolvableLinkInterface () format) as collection in Psr\\Link\\LinkProviderInterface format (see also ).

### Requirements

[](#requirements)

- **PHP &gt;= 8.1**

### Installation

[](#installation)

#### Using composer (recommended)

[](#using-composer-recommended)

```
composer require balpom/links-extractor
```

### How to use

[](#how-to-use)

There are two extractor realisation in this package: Balpom\\LinksExtractor\\SimpleExtractor and Balpom\\LinksExtractor\\Extractor

**SimpleExtractor** usage samples:

```
$css = 'div.cls1{background-image:url(/image-file-1.jpg);}
span.cls2{background-image:url(/image-file-2.png);}';

$extractor = new SimpleExtractor($css, 'text/css');
$linksProvider = $extractor->extract();
print_r($linksProvider->getLinks());
```

```
$html = 'ABCXYZ
Else one ';

$extractor = new SimpleExtractor($html, 'text/html');
$linksProvider = $extractor->extract();
print_r($linksProvider->getLinks());
```

**Extractor** works also as a SimpleExtractor, but takes as a constructor argument an Psr\\Http\\Message\\ResponseInterface object (), not a string.

### License

[](#license)

MIT License See [LICENSE.MD](LICENSE.MD)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~2 days

Total

4

Last Release

717d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5604ae7cc0bdc12fd8cf8867f3518ec3c9628f13707f127e700cdac1aec70b56?d=identicon)[balpom](/maintainers/balpom)

---

Top Contributors

[![balpom](https://avatars.githubusercontent.com/u/141855513?v=4)](https://github.com/balpom "balpom (14 commits)")

---

Tags

httpresponsepsr-7urlurilinkpsr-13parsercsshttp2psr13psr7htmlextractparsingextractorsrchref

### Embed Badge

![Health badge](/badges/balpom-links-extractor/health.svg)

```
[![Health](https://phpackages.com/badges/balpom-links-extractor/health.svg)](https://phpackages.com/packages/balpom-links-extractor)
```

###  Alternatives

[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

8.0k1.0B3.2k](/packages/guzzlehttp-psr7)[symfony/web-link

Manages links between resources

1.4k99.0M251](/packages/symfony-web-link)[league/uri-interfaces

Common tools for parsing and resolving RFC3987/RFC3986 URI

538204.9M23](/packages/league-uri-interfaces)[duzun/hquery

An extremely fast web scraper that parses megabytes of HTML in a blink of an eye. No dependencies. PHP5+

363146.3k4](/packages/duzun-hquery)[crwlr/url

Swiss Army knife for URLs.

11073.3k3](/packages/crwlr-url)[pdeans/http

PSR-7 cURL HTTP client with support for PSR-17 HTTP factories.

1466.2k3](/packages/pdeans-http)

PHPackages © 2026

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