Welcome to the Crawler Blog for Laravel repository! This robust web scraping tool is crafted to effortlessly gather data from blogs and websites, delivering valuable insights and information. Whether you're a content creator, market researcher, or e-commerce entrepreneur, this Laravel-based crawler provides an ideal solution for your data extraction needs.
- Web Scraping: Extract data from various blogs and websites, including blog posts, product descriptions, prices, and customer reviews.
Follow these steps to get the Crawler Blog for Laravel up and running:
- Clone the repository:
composer require giauphan/crawl-blog-data -W
You need to add provider and alias to your config/app.php file:
<?php
'providers' => [
Giauphan\CrawlBlog\CrawlBlogDataServiceProvider::class
],
You need to add commands to your app/Console/Kernel.php file:
protected function commands(): void
{
$this->load(__DIR__.'/Commands');
$this->load(__DIR__.'/../CrawlBlog');
require base_path('routes/console.php');
}
You need to add commands to your bootstrap/app.php file:
use App\CrawlBlog\CrawlExample;
->withCommands([
CrawlExample::class,
])
You can publish and run the migrations with:
php artisan vendor:publish --provider="Giauphan\CrawlBlog\CrawlBlogDataServiceProvider" --tag="migrations"
php artisan migrate
You can publish the config file with:
php artisan vendor:publish --provider="Giauphan\CrawlBlog\CrawlBlogDataServiceProvider" --tag="command"
- Configuration:
- Update the
.env
file to configure the database settings. - Adjust the
CrawlBlogData.php
file to customize scraping behavior based on your requirements.
- Update the
You can generate a new settings class using this artisan command.
php artisan make:crawl-blog CrawlExample
- Executing the Crawler:
Run the crawler via the command line using the following command:
This initiates the web scraping process, and the extracted data will be saved to the configured database tables.
php artisan crawl:CrawlExample url category_name lang limitblog
We welcome contributions from the community! If you encounter bugs, have feature requests, or want to enhance the crawler, please submit issues or pull requests on GitHub.
The Crawler Blog for Laravel is open-source software licensed under the MIT License. Feel free to use, modify, and distribute it following the license terms.
For inquiries or support, contact us at [email protected].
Thank you for using the Crawler Blog for Laravel! Happy scraping!