src/curlient/crawler/PageCrawler.php
public function crawl($conf) {
		$gcfg   = $conf['conf'];//全局配置，包括cookie和header
		$url    = $conf['url'];//要抓取的页面URL
		$cfg    = $conf['page'];//页面规则
		$refer  = isset($conf['refer']) ? $conf['refer'] : '';//列表页URL
		$fields = isset($conf['fields']) ? $conf['fields'] : [];//从列表页来的字段
		// 开始抓取
		if ($url && $cfg['fields']) {
			$gcfg['ip']    = $this->ip;
			$gcfg['refer'] = $refer;
			$client        = Curlient::build($gcfg);
			$content       = $this->getContent($url, $client, $cfg, $gcfg);
			if ($content) {//解析内容
				if (isset($cfg['json'])) {
					$content = @json_decode($content);
				} else if (isset($cfg['dom'])) {
					$content = new Crawler($content);
				}
				$this->parseFields($content, $cfg, $fields);
				if (isset($cfg['pager']['type']) && $cfg['pager']['pages'][0]) {
					$this->getMoreContent($client, $content, $cfg, $fields, $url, $gcfg);
				}
			} else {
				$this->error = '[' . $client->errorCode . ']' . $client->error;

				return false;
			}
		} else {
			$this->error = 'no fields configured';

			return false;
		}
		$fields['抓取时间'] = time();
		$rst            = ['url' => $url, 'fields' => $fields];

		return $rst;
	}
public function crawl($conf) {
		$gcfg   = $conf['conf'];//全局配置，包括cookie和header
		$url    = $conf['url'];//要抓取的页面URL
		$cfg    = $conf['page'];//页面规则
		$refer  = isset($conf['refer']) ? $conf['refer'] : '';//列表页URL
		$fields = isset($conf['fields']) ? $conf['fields'] : [];//从列表页来的字段
		// 开始抓取
		if ($url && $cfg['fields']) {
			$gcfg['ip']    = $this->ip;
			$gcfg['refer'] = $refer;
			$client        = Curlient::build($gcfg);
			$content       = $this->getContent($url, $client, $cfg, $gcfg);
			if ($content) {//解析内容
				if (isset($cfg['json'])) {
					$content = @json_decode($content);
				} else if (isset($cfg['dom'])) {
					$content = new Crawler($content);
				}
				$this->parseFields($content, $cfg, $fields);
				if (isset($cfg['pager']['type']) && $cfg['pager']['pages'][0]) {
					$this->getMoreContent($client, $content, $cfg, $fields, $url, $gcfg);
				}
			} else {
				$this->error = '[' . $client->errorCode . ']' . $client->error;

				return false;
			}
		} else {
			$this->error = 'no fields configured';

			return false;
		}
		$fields['抓取时间'] = time();
		$rst            = ['url' => $url, 'fields' => $fields];

		return $rst;
	}
抓取这一页