akane0151/target-crawler

target crawler - A simple Laravel crawler package to read element of any webpage.

0.9.7 2023-02-15 05:47 UTC

This package is auto-updated.

Last update: 2025-03-15 12:18:15 UTC


README

Built on


Logo

Laravel TargetCrawler

An awesome crawler to simply fetch your specific data from any pages!
Explore the docs ยป

Table of Contents
  1. Installation and Usage
  2. License
  3. Contact

Usage

_Below is an example of how you can use this package in your laravel project.

  1. Install it as composer package in your project
    composer require akane0151/target-crawler
  2. Publish its config in your laravel config directory
    php artisan vendor:publish
  3. 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'
     )
  4. 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!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE.txt for more information.

Contact

Ali kameli akane0151@yahoo.com