myerscode/beacon

A fluent PHP wrapper for web page content retrieval, screenshots, PDFs, Lighthouse audits, and concurrent site crawling using Chrome.

Maintainers

Package info

github.com/myerscode/beacon

pkg:composer/myerscode/beacon

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

dev-main 2026-03-31 18:55 UTC

This package is auto-updated.

Last update: 2026-04-03 07:16:51 UTC


README

Latest Stable Version Total Downloads PHP Version Require License Tests codecov

Beacon

A fluent PHP wrapper around Symfony Panther for web page content retrieval and site analysis. Renders JavaScript-heavy pages (SPAs, React, Vue, etc.) and provides an easy API for source code, screenshots, PDFs, meta tags, link extraction, Lighthouse audits, and concurrent site crawling.

Requirements

  • PHP 8.5+
  • Chrome/Chromium browser installed
  • Node.js 16+ and Lighthouse CLI (only required for Lighthouse features)

Installation

composer require myerscode/beacon

ChromeDriver is installed automatically via dbrekelmans/bdi on composer install.

Quick Start

// Get the fully rendered HTML of any page
$html = beacon()->visit('https://example.com')->source();

// Take a screenshot or save as PDF
beacon()->visit('https://example.com')->screenshot('/tmp/shot.png');
beacon()->visit('https://example.com')->pdf('/tmp/page.pdf');

// Page info
$title  = beacon()->visit('https://example.com')->title();
$status = beacon()->visit('https://example.com')->statusCode();
$links  = beacon()->visit('https://example.com')->links();
$meta   = beacon()->visit('https://example.com')->meta();

// Lighthouse audit
$scores = beacon()->visit('https://example.com')->lighthouse();

// Crawl the site for broken links
$results = beacon()->visit('https://example.com')->crawl();
$broken  = $results->broken();

Documentation

  • Page — content, screenshots, PDF, links, meta, status code
  • Lighthouse — category scores, individual audits, configuration, reports
  • Crawler — concurrent spider crawl, broken link detection, retries, throttling
  • Advanced Usage — browser configuration, dependency checking

License

MIT