Description
Roach is a web scraping toolkit for PHP. The project describes it as a clone heavily inspired by the Scrapy package for Python. You define spiders that crawl and scrape web documents, and an item pipeline cleans, stores and processes the extracted data. The core package works on its own and does not depend on a framework, and there is a first-party adapter for using Roach in Laravel projects, with more adapters planned. Most of the built-in behavior works the same way as custom extensions and middleware, so you can extend each stage. For example, you write an item processor to save scraped data to the store you choose, a downloader middleware to add custom HTTP headers to outgoing requests based on conditions, and an extension that listens for run events, such as one that posts a message when a run finishes. The documentation covers getting started, spiders, responses and items, the interactive shell, spider and downloader middleware, extensions, dependency injection, testing, and framework integration with Laravel and Symfony. The source is on GitHub under the roach-php organization.…
Highlights
- Spiders that crawl and scrape web documents
- Item pipeline to clean and store extracted data
- Framework-agnostic core package
- Middleware and extensions at each stage
- Laravel adapter and Symfony integration docs
Ratings & Reviews
No ratings yet
Be the first to rate Core.
People also visit
Scrapydweb
Web app for Scrapyd cluster management, Scrapy log analysis & visualization
Core FAQ
What is Roach?
A web scraping toolkit for PHP, inspired by the Python package Scrapy.
Does it need a framework?
No. The core package works on its own, and framework adapters are optional.
How do I save scraped data?
Write an item processor, which the docs describe as the way to store data in your persistence of choice.
Can I add custom headers to requests?
Yes. A downloader middleware can add headers to outgoing requests based on conditions.
Where are the docs?
On roach-php.dev, which covers getting started, spiders, items, middleware, extensions, testing and framework integration.
What are the best Core alternatives?
Popular alternatives to Core include PHPScraper, Scrapemate and Web Scraping. See all Core alternatives



