setRule (array $url) : object

参数

@param  array  $rule    任务规则
$rule = [
    '规则名1' => ['选择器1','元素属性'],
    '规则名2' => ['选择器2','元素属性'],
    // ...
];

含义

用于设定任务规则

举栗

$rule = [
];

//直接调用
Task::getInstance()->setRule($rule);

//通过phpcreeper实例调用
$this->worker->getTaskMan()->setRule($rule);

results matching ""

    No results matching ""