deepslam/content-parser
Laravel 5 package to extract a web page’s main content and title using automatic algorithms. Supports Graby (default) and Mercury API parsers, with an extensible architecture and optional HTML cleanup (remove CSS/style attrs, strip tags) for clean output.
DOMDocument/DOMXPath) and integrates cleanly with Laravel’s queue system, HTTP clients, and service container. Could complement Laravel’s Scout (search) or Nova (admin) for enriched data pipelines.<article>, <main>, or custom selectors via XPath/CSS.ParseContentJob)./api/scrape?url=...).schedule:run.robots.txt)?guzzlehttp/guzzle (for HTTP requests, if not using Laravel’s HTTP client).spatie/array-to-object (to convert parsed arrays to objects).spatie/laravel-activitylog (to audit scrape jobs).['title' => '...', 'content' => '...']).app/Services/ContentParserService) to abstract the package, adding:
throw \RuntimeException for failed requests).Illuminate\Support\Facades\Cache::remember).Log::info('Scraped URL: ...')).ParseUrlJob) with delayed processing.ParseUrlJob::dispatch($url)->onQueue('scraping');
// Route
Route::post('/scrape', [ScrapeController::class, 'handle']);
// Artisan
Artisan::call('scrape:run', ['url' => 'https://example.com']);
laravel/framework v8.x as a dependency to avoid conflicts."preload-autoload": true to composer.json).composer why-not to audit).dd($dom->saveHTML())).php artisan queue:work --queue=scraping).parallel:for (Laravel 10+) or Laravel Jobs with batches.Model::insert($data)) to reduce queries.scrapinghub/python-scrapy proxies or paid services).| Failure Type | Impact | Mitigation |
|---|---|---|
| Package Deprecation | Breaks with PHP 8.x+ | Fork/maintain or switch to modern alternative. |
| Target Site Blocks | IP bans, CAPTCHAs | Proxies, user-agent rotation, delays. |
| Malformed HTML | Parser crashes | Add try-catch blocks; log failed URLs. |
| Queue Overload | Scraping jobs pile up | Monitor queue:failed; scale workers. |
| Data Duplication | Redundant scrapes | Use unique() in queries or Laravel Cache. |
How can I help you explore Laravel packages today?