Ejemplo n.º 1
0
 public function getProductID()
 {
     $str = parent::getProductID();
     $sourceurl = parent::getUrl();
     $data = parent::getPriceUrl();
     $arr = parse_url($sourceurl);
     $baseurl = $arr['host'];
     $p = '/esf.(\\w+).fang/';
     preg_match($p, $baseurl, $out);
     $s = isset($out[1]) ? $out[1] : "";
     $this->_productID = $s . '-' . $str;
     return $this->_productID;
 }
 public function getPriceUrl()
 {
     $str = parent::getPriceUrl();
     $this->_priceUrl = trim(str_replace("服务热线:", "", $str));
     return $this->_priceUrl;
 }
Ejemplo n.º 3
0
 public function getPriceUrl()
 {
     $sourceurl = parent::getUrl();
     $arr = parse_url($sourceurl);
     $baseurl = $arr['scheme'] . "://" . $arr['host'];
     $data = parent::getPriceUrl();
     if (!$data) {
         $this->_priceUrl = array();
         $filter = '//div[@class="site-child-arae"]/a/@href||2';
         $tmp = $this->_getRegexpInfo($filter, $this->getContent());
         foreach ($tmp as $k => $v) {
             if (strstr($v, 'javascript')) {
                 $v = $sourceurl;
             }
             if (!strstr($v, "http")) {
                 $this->_priceUrl[$k] = $baseurl . $v;
             } else {
                 $this->_priceUrl[$k] = $v;
             }
         }
     } else {
         foreach ($data as $k => $v) {
             if (strstr($v, 'javascript')) {
                 $v = $sourceurl;
             }
             if (!strstr($v, "http")) {
                 $this->_priceUrl[$k] = $baseurl . $v;
             } else {
                 $this->_priceUrl[$k] = $v;
             }
         }
     }
     return $this->_priceUrl;
 }