weblabormx/scrapping-plus
Composer 安装命令:
composer require weblabormx/scrapping-plus
包简介
Package for making scrapping with different drivers and one format.
README 文档
README
Laravel package for scrapping with different drivers.
This package will help you for scrapping any website, even the ones done completly by javascript. This is done thanks the different drivers that handles the scrapping.
In this package we use the next drivers
- Parser (paquettg/php-html-parser)
- Laravel Dusk (laravel/dusk)
- Voku (voku/simple_html_dom)
Installation
You can install the package via composer:
composer require weblabormx/scrapping-plus
Usage
For using the Parser one you need to execute something like this.
use WeblaborMX\ScrappingPlus\Scrapping; // Using html directly $scrapper = Scrapping::fromHtml('<html><body><h1>Hola</h1><p>Excerpt</p></body></html>'); $h1 = $scrapper->first('h1'); $text = $h1->getText(); // Hola // Get it from an URL $google = Scrapping::scrappe('https://www.google.com.mx'); $html = $google->getHtml(); // Access inputs $inputs = $google->get('input'); $this->assertEquals(5, $inputs->count()); $first = $inputs->first(); $second = $inputs[1]; $class = $google->first('input[name=btnI]'); $title = $class->getAttribute('value');
And if you want to execute it with laravel dusk you just need to execute something like this:
$page = Scrapping::method('dusk')->scrappe($url); $page->object->waitForText($text); // How to use laravel dusk functions directly $page = $page->toParser(); // Convert to the parser driver
The list of functions that every driver has are the next ones:
get($selector)getHtmlgetAttribute($name)getLinkgetText
Testing
phpunit test
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email carlosescobar@weblabor.mx instead of using the issue tracker.
Emailware
You're free to use this package, but if it makes it to your production environment we highly appreciate you sending an email with the url of the website in production to add it to our website
Our email address is: carlosescobar@weblabor.mx
We publish all received emails on our company website.
Credits
Support us
Weblabor is a web design agency based in México. You'll find an overview of all our open source projects on our website.
Does your business depend on our contributions? Reach out and support us All pledges will be dedicated to allocating workforce on maintenance and new awesome stuff.
- Support us on Patreon - https://www.patreon.com/weblabormx
- Support us with a Paypal donation - https://paypal.me/weblabormx
License
The MIT License (MIT). Please see License File for more information.
weblabormx/scrapping-plus 适用场景与选型建议
weblabormx/scrapping-plus 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4.66k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2018 年 08 月 26 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「weblabormx」 「scrapping-plus」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 weblabormx/scrapping-plus 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 weblabormx/scrapping-plus 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 weblabormx/scrapping-plus 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
统计信息
- 总下载量: 4.66k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-08-26