balkon-developer / table-scraper
Table scrapers with unmerge cell.
dev-dev
2020-10-13 08:41 UTC
Requires
- php: >=7.2.5
- guzzlehttp/guzzle: ^7.0
- illuminate/support: ^7.0 || ^8.0
- symfony/css-selector: ^5.1
Requires (Dev)
- phpunit/phpunit: ^8
This package is not auto-updated.
Last update: 2024-11-06 13:53:08 UTC
README
PHP Table Scraper
a package to help you scraping one or some tables in a website and automatically unmerge the cells. The result, you get the data as Collection. It's useful for me, I hope it will helpful for you so.
Installation
composer require balkon-developer/table-scraper
How to use
- Get a table with css selector, the result is
ScrapeTable
class
use BalkonDeveloper\TableScraper\Scrape; $url = 'https://your-target-website'; $scrape = Scrape::fromUrl($url); $tableSelector = '.target'; $table = $scrape->table($tableSelector); // var_dump($table)
- Get multiple tables with css selector, the result is
Collection
ofScrapeTable
class
use BalkonDeveloper\TableScraper\Scrape; $url = 'https://your-target-website'; $scrape = Scrape::fromUrl($url); $tableSelector = '.target'; $tables = $scrape->tables($tableSelector); // var_dump($tables)
- Get all tables, the result is
Collection
ofScrapeTable
class
use BalkonDeveloper\TableScraper\Scrape; $url = 'https://your-target-website'; $scrape = Scrape::fromUrl($url); $tables = $scrape->tables(); // var_dump($tables)