src/curlient/crawler/ListCrawler.php
public function crawl($config, $filter = null) {
		$pages = [];
		$gcfg  = $config['conf'];
		$cfg   = $config['list'];
		$url   = $config['url'];

		//$cfg['pages']为URL提取规则
		if ($url && $cfg['pages']) {//可以抓取
			$gcfg['ip'] = $this->ip;
			$client     = Curlient::build($gcfg);

			if (isset($cfg['method']) && $cfg['method'] == 'post') {
				$client->request($url, 'post', isset($cfg['data']) ? $cfg['data'] : null);
			} else {
				$client->request($url);
			}

			if (isset($cfg['ajax'])) {
				$client->ajax();
			}

			if (isset($cfg['encoding'])) {
				$encoding = $cfg['encoding'];
			} else if (isset($gcfg['encoding'])) {
				$encoding = $gcfg['encoding'];
			}

			$isJson = false;
			if (isset($cfg['json']) && $cfg['json']) {
				$content = $client->json(isset($encoding) ? $encoding : null);
				$isJson  = true;
			} else {
				$content = $client->text(isset($encoding) ? $encoding : null);
			}
			$cookies = $client->getCookies();
			if ($cookies) {
				$gcfg['cookie'] = isset($gcfg['cookie']) && is_array($gcfg['cookie']) ? @array_merge($gcfg['cookie'], $cookies) : $cookies;
			}
			if ($content) {//解析内容
				if ($isJson) {
					$this->parseJsonData($content, $cfg, $pages, $gcfg, $url);
				} else if (isset($cfg['dom'])) {
					$content = new Crawler($content);
					$this->parseDomData($content, $cfg, $pages, $gcfg, $url);
				} else {
					$this->parseTextData($content, $cfg, $pages, $gcfg, $url);
				}
			}
		}
		$pages = $this->unique($pages);
		if ($cfg['includes']) {
			$pages = $this->includes($pages, $cfg['includes']);
		}
		if ($cfg['excludes']) {
			$pages = $this->excludes($pages, $cfg['excludes']);
		}

		if ($pages) {
			Curlient::goodURL($url, $pages);//完整URL
		}

		if ($pages && $filter) {
			$pages = call_user_func_array($filter, [$pages]);
		}

		return $pages;
	}
public function crawl($config, $filter = null) {
		$pages = [];
		$gcfg  = $config['conf'];
		$cfg   = $config['list'];
		$url   = $config['url'];

		//$cfg['pages']为URL提取规则
		if ($url && $cfg['pages']) {//可以抓取
			$gcfg['ip'] = $this->ip;
			$client     = Curlient::build($gcfg);

			if (isset($cfg['method']) && $cfg['method'] == 'post') {
				$client->request($url, 'post', isset($cfg['data']) ? $cfg['data'] : null);
			} else {
				$client->request($url);
			}

			if (isset($cfg['ajax'])) {
				$client->ajax();
			}

			if (isset($cfg['encoding'])) {
				$encoding = $cfg['encoding'];
			} else if (isset($gcfg['encoding'])) {
				$encoding = $gcfg['encoding'];
			}

			$isJson = false;
			if (isset($cfg['json']) && $cfg['json']) {
				$content = $client->json(isset($encoding) ? $encoding : null);
				$isJson  = true;
			} else {
				$content = $client->text(isset($encoding) ? $encoding : null);
			}
			$cookies = $client->getCookies();
			if ($cookies) {
				$gcfg['cookie'] = isset($gcfg['cookie']) && is_array($gcfg['cookie']) ? @array_merge($gcfg['cookie'], $cookies) : $cookies;
			}
			if ($content) {//解析内容
				if ($isJson) {
					$this->parseJsonData($content, $cfg, $pages, $gcfg, $url);
				} else if (isset($cfg['dom'])) {
					$content = new Crawler($content);
					$this->parseDomData($content, $cfg, $pages, $gcfg, $url);
				} else {
					$this->parseTextData($content, $cfg, $pages, $gcfg, $url);
				}
			}
		}
		$pages = $this->unique($pages);
		if ($cfg['includes']) {
			$pages = $this->includes($pages, $cfg['includes']);
		}
		if ($cfg['excludes']) {
			$pages = $this->excludes($pages, $cfg['excludes']);
		}

		if ($pages) {
			Curlient::goodURL($url, $pages);//完整URL
		}

		if ($pages && $filter) {
			$pages = call_user_func_array($filter, [$pages]);
		}

		return $pages;
	}
抓取一个列表页.

@param array    $config
@param \Closure $filter

@return array