Skip to content

myerscode/beacon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 or higher
  • Chrome/Chromium browser installed
  • Node.js 16 or higher (only required for Lighthouse features)
  • Lighthouse CLI (only required for Lighthouse features)

Installation

composer require myerscode/beacon

ChromeDriver is installed automatically on composer install — Beacon detects your Chrome version and downloads the matching driver for your platform. See Managing Dependencies for manual install, update, and clean commands.

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 management
  • CI/CD — GitHub Actions, GitLab CI, and other pipeline setups

Issues

Bug reports and feature requests can be submitted on the Github Issue Tracker.

Contributing

Contributions are welcome! Please see contributing.md for guidelines on how to contribute to this project.

License

The MIT License (MIT). Please see License File for more information.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages