承接 refactors/smart-scraper 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

refactors/smart-scraper

最新稳定版本:v0.0.8

Composer 安装命令:

composer require refactors/smart-scraper

包简介

A smart PHP web scraper.

README 文档

README

Latest Stable Version Total Downloads License

Smart Scraper is a PHP scraper to scrape information from web pages. It can help you doing that horrible task in a very easy and smart way.

Installation

Smart Scrapper needs PHP 5.6.0+ and you can use it via Composer:

composer require refactores/smart-scraper

Usage

Create a Smart Scraper instance:

$scraper = new SmartScraper\Parser($theUrlYouWantToScrape);

Then, if you want to save the text of some selector, you should use:

$scraper->saveText($name, $expression, [$attribute = null]);

The value is saved on $scraper->{$name}. Example:

$scraper->saveText( 'nick', '.header h1' );
echo $scraper->nick;

If you just want to receive the HTML you must use:

$scraper->saveHtml($name, $expression, [$index = 0]);

The $index referes to the position of the element in the page in the case of having more than one.

统计信息

  • 总下载量: 37
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-05-27