public function getPrice() { $str = parent::getPrice(); $this->_price = str_replace("门店名称:", "", $str); return $this->_price; }
public function getPrice() { $data = parent::getPrice(); $sourceurl = parent::getUrl(); $arr = parse_url($sourceurl); $baseurl = $arr['scheme'] . "://" . $arr['host']; if (!$data) { $this->_price = array(); $filter = '//li[@class="site-topsearch"][2]/a/@href||2'; $tmp = $this->_getRegexpInfo($filter, $this->getContent()); $sourceurl = parent::getUrl(); foreach ($tmp as $k => $v) { if (strstr($v, 'javascript')) { $v = $sourceurl; } if (!strstr($v, "http")) { $this->_price[$k] = $baseurl . $v; } else { $this->_price[$k] = $v; } } } else { foreach ($data as $k => $v) { if (strstr($v, 'javascript')) { $v = $sourceurl; } if (!strstr($v, "http")) { $this->_price[$k] = $baseurl . $v; } else { $this->_price[$k] = $v; } } } return $this->_price; }