PHPackages                             revolution/salvager - 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. revolution/salvager

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

revolution/salvager
===================

Tiny WebCrawler for Laravel using Playwright

2.2.13(2mo ago)78.5k—0%3MITPHPPHP ^8.3CI passing

Since Jan 1Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/invokable/salvager)[ Packagist](https://packagist.org/packages/revolution/salvager)[ GitHub Sponsors](https://github.com/invokable)[ RSS](/packages/revolution-salvager/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (7)Versions (37)Used By (0)

Salvager
========

[](#salvager)

Tiny WebCrawler for Laravel using Playwright.

Version 2
---------

[](#version-2)

Version 2 has been reworked as a simple package that depends on Playwright. It only implements minimal functionality, since you can use [playwright-php/playwright](https://github.com/playwright-php/playwright) directly.

In addition, version 2.2 now supports the Vercel [agent-browser](https://github.com/vercel-labs/agent-browser).

Requirements
------------

[](#requirements)

- PHP &gt;= 8.3
- Laravel &gt;= 12.x

Installation
------------

[](#installation)

```
composer require revolution/salvager
```

### Playwright

[](#playwright)

Install Playwright browsers:

```
vendor/bin/playwright-install --browsers
```

Or install Playwright browsers with OS dependencies:

```
vendor/bin/playwright-install --with-deps
```

### Vercel agent-browser

[](#vercel-agent-browser)

#### Global installation and use Chromium binary

[](#global-installation-and-use-chromium-binary)

Install agent-browser and Chromium globally and run it as a Laravel Process.

Warning

This doesn't work with Vercel or Laravel Cloud. See below.

```
npm install -g agent-browser
agent-browser install

# Linux
agent-browser install --with-deps
```

```
# .env
SALVAGER_AGENT_BROWSER_PATH=/path/to/agent-browser
SALVAGER_AGENT_BROWSER_OPTIONS=
```

If you want to use custom Chromium binary `@sparticuz/chromium`, you can specify it in shell environment variables.

```
AGENT_BROWSER_EXECUTABLE_PATH=/tmp/chromium
```

```
# .env
SALVAGER_INSTALL_CHROMIUM="node ./scripts/install-chromium.js"
```

#### Local installation and use Cloud provider

[](#local-installation-and-use-cloud-provider)

You can also install agent-browser locally and use it with Cloud provider such as Browserbase or Browser Use.

This should work on Vercel and Laravel Cloud, which cannot install OS deps.

Install in your Laravel project. Requires agent-browser v0.7.6 or later.

```
npm install agent-browser
```

```
# .env
SALVAGER_AGENT_BROWSER_PATH="npx agent-browser"
SALVAGER_AGENT_BROWSER_OPTIONS=
```

Set it in the shell environment variables instead of .env.

```
AGENT_BROWSER_PROVIDER=browserbase
BROWSERBASE_PROJECT_ID="your-project-id"
BROWSERBASE_API_KEY="your-api-key"
```

```
AGENT_BROWSER_PROVIDER=browseruse
BROWSER_USE_API_KEY="your-api-key"
```

Vercel also requires AGENT\_BROWSER\_SOCKET\_DIR.

```
AGENT_BROWSER_SOCKET_DIR=/tmp/
```

I have confirmed that it works with Vercel and Browserbase.

Usage
-----

[](#usage)

### Playwright

[](#playwright-1)

The browser will be terminated when you exit `Salvager::browse()`, so please obtain any necessary data within the `Salvager::browse()` closure. The Page object cannot be used outside of `Salvager::browse()`.

```
use Revolution\Salvager\Facades\Salvager;
use Playwright\Page\Page;

class SalvagerController
{
    public function __invoke()
    {
         Salvager::browse(function (Page $page) use (&$url, &$text) {
            $page->goto('https://example.com/');
            $page->screenshot(config('salvager.screenshots').'example.png');

            $url = $page->url();
            $text = $page->locator('p')->first()->innerText();
        });

        dump($url);
        dump($text);
    }
}
```

If you want more control, just launch the browser with `Salvager::launch()`.

```
use Playwright\Browser\BrowserContextInterface;
use Revolution\Salvager\Facades\Salvager;

/* @var BrowserContextInterface $browser */
$browser = Salvager::launch();

$page = $browser->newPage();
$page->goto('https://example.com/');
// Do something...

// Don't forget to close the browser
$page->close();
$browser->close();
```

### Vercel agent-browser

[](#vercel-agent-browser-1)

```
use Revolution\Salvager\AgentBrowser;
use Revolution\Salvager\Facades\Salvager;

Salvager::agent(function (AgentBrowser $agent) use (&$url, &$text, &$html) {
    $agent->userAgent('Chromium');
    $agent->open('https://example.com/');
    $agent->screenshot(config('salvager.screenshots').'agent-test.png');

    $url = $agent->url();
    $text = $agent->text('p:last-of-type', '--json');
    $html = $agent->html('html');

    // Run any agent-browser command
    $result = $agent->run(command: '', args: '', options: '');

    // If you are using a cloud provider, it is recommended not to close manually.
    // $agent->close();
});
```

LICENSE
-------

[](#license)

MIT

###  Health Score

59

—

FairBetter than 99% of packages

Maintenance86

Actively maintained with recent releases

Popularity32

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity87

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 99.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 ~76 days

Recently: every ~8 days

Total

35

Last Release

86d ago

Major Versions

1.x-dev → 2.0.02025-12-12

PHP version history (6 changes)1.0.0PHP &gt;=7.1.3

1.3.0PHP ^7.2||^8.0

1.4.0PHP ^7.3||^8.0

1.5.0PHP ^8.0

2.0.0PHP ^8.4

2.0.2PHP ^8.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/77618633?v=4)[Revolution](/maintainers/revolution)[@Revolution](https://github.com/Revolution)

---

Top Contributors

[![kawax](https://avatars.githubusercontent.com/u/1502086?v=4)](https://github.com/kawax "kawax (137 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (1 commits)")

---

Tags

laravelplaywright

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/revolution-salvager/health.svg)

```
[![Health](https://phpackages.com/badges/revolution-salvager/health.svg)](https://phpackages.com/packages/revolution-salvager)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)[nedwors/navigator

A Laravel package to ease defining navigation menus

433.1k](/packages/nedwors-navigator)[xefi/faker-php-laravel

Faker php integration with laravel

1915.1k](/packages/xefi-faker-php-laravel)[dcblogdev/laravel-junie

Install pre-configured guides for Jetbrains Junie

392.5k](/packages/dcblogdev-laravel-junie)

PHPackages © 2026

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