/** * 获取文章详情 * @param [type] &$item [description] * @return [type] [description] */ public function getContent(&$item) { if (!isset($item['url'])) { WxSpider::error('没有url信息 '); return; } $url = "http://weixin.sogou.com" . $item['url']; $data = $this->getData($url); $pattern = "/js_content\">(.*?)<\\/div>/is"; if (preg_match($pattern, $data, $matchs)) { $str = str_replace("data-src", "src", $matchs[1]); $item['content'] = $str; return true; } }