Download the PHP package kiddyu/beanbun-parser without Composer

On this page you can find all versions of the php package kiddyu/beanbun-parser. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package beanbun-parser

beanbun-parser

简介

beanbun-parser 是 Beanbun 的数据抽取插件。通过设置抽取规则,在每次爬取页面之后,可以自动提取页面数据到数组中以供使用。抽取规则的选择器语法类似于 jQuery,使用简单。
插件使用了 phpQueryquerylist 两个包。

安装

通过 composer 进行安装。

使用

只需实例化后,通过 Beanbun::middleware() 加载即可。实例化时,可接受一个参数,类型为数组,内容为对 beanbun-parser 的配置,加载后 Beanbun 实例会增加 $parser 属性,属性值即为 beanbun-parser 实例。
目前只接受一个选项 auto,即插件是否按照规则自动抽取数据,默认为 true。
auto 为 true 时,Beanbun 实例会增加 $fields、$data 两个属性。$fields 为抽取规则,$data 为抽取到的数据。

Beanbun 属性

Beanbun::$fields

$fields 每个抽取项可以包含一下元素
name: 此项数据的变量名
selector: 抽取规则。包含两个元素,前一个为 jQuery 风格的选择器,后一个为要抽取的属性,可选为 text、html、[HTML标签属性]:如src、href、name、data-src等任意HTML标签属性名
repeated: 定义抽取到的内容是否是有多项, 默认 false
required: 定义该 field 的值是否必须, 默认 false
children: 为此 field 定义子项,子项的定义仍然是一个fields数组,没错, 这是一个树形结构

Beanbun::$data

$data 是抽取到的数据,在 Beanbun 中 afterDownloadPage 和其之后的回调函数中都可以使用

Beanbun::$parser 可用方法

getData
接受一个参数 $feilds,格式与上面提到的 Beanbun::$fields 相同。

完整示例


All versions of beanbun-parser with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.0
jaeger/querylist Version ^3.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package kiddyu/beanbun-parser contains the following files

Loading the files please wait ....