Home > php教程 > php手册 > PHP采集淘宝的店铺的大小分类

PHP采集淘宝的店铺的大小分类

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 11:40:53
Original
1321 people have browsed it

PHP采集淘宝的店铺的大小分类
//取店铺大分类 $shopurl=店铺地址<br> function ShopType1($shopurl){<br> $url=file_get_contents($shopurl.'/search.htm?spm=a1z10.5.0.0.PXlPZX&search=y');<br> $shoptype='#<i></i>(.*)<a>(.*)</a>#iUs';<br> preg_match_all($shoptype,$url,$type);<br> for($i=0;$i<count></count>     $Tyep1['TypeId'][$i]=$type[4][$i]; //取到大分类ID号<br>     $Tyep1['TypeName'][$i]=trim($type[7][$i]); //取到大分类名称<br> }<br> return $Tyep1;<br> }<br> <br> //取店铺小分类 $shopurl=店铺地址<br> function ShopType2($shopurl){<br> $url=file_get_contents($shopurl.'/search.htm?spm=a1z10.5.0.0.PXlPZX&search=y');<br> //$shoptype='#<i></i>(.*)<a>(.*)</a>#iUs';<br> $shoptype='#<h4>(.*)<i></i><a>(.*)</a>(.*)</h4>#iUs';<br> preg_match_all($shoptype,$url,$type);<br> for($i=0;$i<count></count>     $Tyep2['TypeId'][$i]=$type[5][$i]; //取到小分类ID<br>     $Tyep2['TypeSId'][$i]=$type[7][$i]; //取到小分类所属的上级分类(大分类ID)<br>     $Tyep2['TypeName'][$i]=trim($type[10][$i]); //取到小分类名称<br> }<br> return $Tyep2;<br> }<br> <br> //淘宝分类地址 http://店铺域名/category-(分类的ID号,大小分类都一样).htm<br> //其他采集处理就由你们自己去动动脑子吧, 这是我一个朋友做SDK模板让我帮他写的PHP采集淘宝的店铺的大小分类

AD:真正免费,域名+虚机+企业邮箱=0元

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template