PHPackages                             katsana/dusk-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. katsana/dusk-crawler

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

katsana/dusk-crawler
====================

Web Crawler using Laravel Dusk

v0.1.6(5y ago)2413.1k↓20%8MITPHPPHP &gt;=7.2CI failing

Since Jan 30Pushed 5y ago3 watchersCompare

[ Source](https://github.com/katsana/dusk-crawler)[ Packagist](https://packagist.org/packages/katsana/dusk-crawler)[ RSS](/packages/katsana-dusk-crawler/feed)WikiDiscussions master Synced today

READMEChangelog (5)Dependencies (7)Versions (11)Used By (0)

Web Crawler using Laravel Dusk
==============================

[](#web-crawler-using-laravel-dusk)

[![tests](https://github.com/katsana/dusk-crawler/workflows/tests/badge.svg?branch=master)](https://github.com/katsana/dusk-crawler/actions?query=workflow%3Atests+branch%3Amaster)[![Latest Stable Version](https://camo.githubusercontent.com/c2b1f630e6a16fa84e7e74236f33e1caea692b0055edd85786ced3cbf059eefc/68747470733a2f2f706f7365722e707567782e6f72672f6b617473616e612f6475736b2d637261776c65722f762f737461626c65)](https://packagist.org/packages/katsana/dusk-crawler)[![Total Downloads](https://camo.githubusercontent.com/79cd47b1a24274a1cd39712522f3d662818c7b6950d535a61df0471b2d41b5b9/68747470733a2f2f706f7365722e707567782e6f72672f6b617473616e612f6475736b2d637261776c65722f646f776e6c6f616473)](https://packagist.org/packages/katsana/dusk-crawler)[![Latest Unstable Version](https://camo.githubusercontent.com/765a9012b93a8fdab882c6e5495550bbf550e9ea269a1eaba36255ffca643254/68747470733a2f2f706f7365722e707567782e6f72672f6b617473616e612f6475736b2d637261776c65722f762f756e737461626c65)](https://packagist.org/packages/katsana/dusk-crawler)[![License](https://camo.githubusercontent.com/194b08e898aacaafc87d9546f787354f869a1dc5b3d61c950743aef7900962f9/68747470733a2f2f706f7365722e707567782e6f72672f6b617473616e612f6475736b2d637261776c65722f6c6963656e7365)](https://packagist.org/packages/katsana/dusk-crawler)

**Laravel Dusk** enables developer to run browser automation but it does lack the ability to navigate actions based on response received on the browser. If you need to handle failure you have to wait until the timeout expired and handle the generic exception.

**Dusk Crawler** solve this by adding `inspectUsing()` method to allow developer to inspect for success or fail status using [Promise by ReactPHP](https://github.com/reactphp/promise).

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

[](#installation)

Dusk Crawler can be installed via composer:

```
composer require "katsana/dusk-crawler"

```

### Usages

[](#usages)

**Dusk Crawler** just add two new macros to `Laravel\Dusk\Browser`:

MethodDescription`inspectUsing()`Similar to `waitUsing()` but allow you to either return `abort(string $exception)`/`reject(\Throwable $throwable)` (fail) or `resolve()` (success) state based on available elements or texts on the browser.`crawler`Return an instance of `Symfony\Component\DomCrawler\Crawler` to allow developer to crawl the result.#### Example

[](#example)

Let say you want to crawl Packagist to search for some package, and the input is dynamic.

```
use DuskCrawler\Dusk;
use DuskCrawler\Inspector;
use DuskCrawler\Exceptions\InspectionFailed;
use Laravel\Dusk\Browser;

function searchPackagist(string $packagist) {
    $dusk = new Dusk('search-packagist');

    $dusk->headless()->disableGpu()->noSandbox();
    $dusk->userAgent('Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36');

    $dusk->start();

    $dusk->browse(function ($browser) use ($packagist) {
        $browser->visit('https://packagist.org/');

        $promise = $browser->type('search_query[query]', $packagist, '{enter}')
            ->inspectUsing(15, function (Browser $browser, Inspector $inspector) {
                $searchList = $browser->resolver->findOrFail('.search-list');

                if (! $searchList->isDisplayed() || $searchList->getText() == '') {
                    // result not ready, just return false.
                    return false;
                }

                if ($searchList->getText() == 'No packages found.') {
                    return $inspector->abort('No packages found!');
                }

                return $inspector->resolve();
            });

        $promise->then(function ($browser) {
            // Crawl the page on success.
            $packages = $browser->crawler()
              ->filter('div.package-item')->each(function ($div) {
                return $div->text();
            });

            dump($packages);
        })->otherwise(function (InspectionFailed $exception) {
            // Handle abort state.
            dump("No result");
        })->done();
    });

    $dusk->stop();
}

searchPackagist('dusk-crawler');

Dusk::closeAll();
```

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity48

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 ~29 days

Recently: every ~54 days

Total

10

Last Release

2082d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/172966?v=4)[Mior Muhammad Zaki](/maintainers/crynobone)[@crynobone](https://github.com/crynobone)

---

Top Contributors

[![crynobone](https://avatars.githubusercontent.com/u/172966?v=4)](https://github.com/crynobone "crynobone (55 commits)")

### Embed Badge

![Health badge](/badges/katsana-dusk-crawler/health.svg)

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

###  Alternatives

[composer/composer

Composer helps you declare, manage and install dependencies of PHP projects. It ensures you have the right stack everywhere.

29.5k196.2M3.1k](/packages/composer-composer)[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[orchestra/canvas

Code Generators for Laravel Applications and Packages

20920.6M192](/packages/orchestra-canvas)[blackfire/player

A powerful web crawler and web scraper with Blackfire support

49617.1k](/packages/blackfire-player)[internal/dload

Downloads binaries.

102212.3k19](/packages/internal-dload)

PHPackages © 2026

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