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.
- 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)
composer require myerscode/beaconChromeDriver 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.
// 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();- 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
Bug reports and feature requests can be submitted on the Github Issue Tracker.
Contributions are welcome! Please see contributing.md for guidelines on how to contribute to this project.
The MIT License (MIT). Please see License File for more information.