akane0151 / target-crawler
target crawler - A simple Laravel crawler package to read element of any webpage.
Requires
- fabpot/goutte: ^4.0
- guzzlehttp/guzzle: ^7.0.1
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Laravel TargetCrawler
An awesome crawler to simply fetch your specific data from any pages!
Explore the docs ยป
Table of Contents
Usage
_Below is an example of how you can use this package in your laravel project.
- Install it as composer package in your project
composer require akane0151/target-crawler
- Publish its config in your laravel config directory
php artisan vendor:publish
- Set your target website url and the html elements in config/targetCrawler.php
'url' => "https://google.com" 'elements' => array( 'a .menu-item', 'table tbody tr .id' )
- Add _Akane0151\TargetCrawler\TargetCrawler namespace to your code and call crawl function as below example
public function getPrice(){ //call doCrawl to execute crawl request to target and fetch the element data return TargetCrawler::doCrawl(); }
Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
License
Distributed under the MIT License. See LICENSE.txt for more information.
Contact
Ali kameli akane0151@yahoo.com