双12必买清单特色商品池

QQ截图20171108171401.jpg

https://kxuan.taobao.com/search.htm?ntoffset=0&s=135&cat=&bcoffset=2&uniq=pid&navigator=all&id=3266&kxuan_swyt_c2c=9158

1:    动漫周边                                                                                    data-value="54334001"   title="动漫周边"                    
2:    Cosplay服饰/道具                                                                            data-value="50036940"   title="Cosplay服饰/道具"            
3:    手办/盒蛋/兵人/人偶/BJD                                                                     data-value="50097453"   title="手办/盒蛋/兵人/人偶/BJD"     
4:    热门动漫服饰                                                                                data-value="56454019"   title="热门动漫服饰"                
5:    高达/机甲/变形金刚/拼装模型                                                                 data-value="50007088"   title="高达/机甲/变形金刚/拼装模型" 
6:    游戏实物周边                                                                                data-value="50077168"   title="游戏实物周边"                
7:    热门动漫游戏                                                                                data-value="56428013"   title="热门动漫游戏"                
8:    聚会用品/装饰/表演服                                                                        data-value="56772021"   title="洛丽塔/软妹装/洋装"          
9:    洛丽塔/软妹装/洋装                                                                          data-value="50036939"   title="聚会用品/装饰/表演服"        
10:    毛绒玩具/公仔                                                                               data-value="56456012"   title="毛绒玩具/公仔"               
11:    影视/明星周边                                                                               data-value="50077309"   title="影视/明星周边"               
12:    模型制作工具                                                                                data-value="50043831"   title="模型制作工具"                
13:    动漫游戏纸模                                                                                data-value="56522002"   title="动漫游戏纸模"                
14:    预定专区-模型手办                                                                           data-value="56428004"   title="预定专区-模型手办"           
15:    纸模/纸质模型                                                                               data-value="56422033"   title="纸模/纸质模型"               
16:    桌游/棋牌                                                                                   data-value="50097451"   title="桌游/棋牌"                   
17:    文化/体育周边                                                                               data-value="56816004"   title="文化/体育周边"               
18:    专业航模/车船模/军模/无人机                                                                 data-value="56354007"   title="专业航模/车船模/军模/无人机"
主体代码如下  insert_goods入库函数自己完成
$cat_array=array(
    "50344007",
    "50008090",
    "27",
    "50102996",
    "50008164",
    "50010728",
    "50008165",
    "50035867",
    "55086007",
    "50006842",
    "50016853",
    "25",
    "50065205",
    "50065206",
    "1705",
    "1801",
    "1625",
    "50067081",
    "50072688",
    "50106154",
    "50006004",
    "50018627",
    "50468016",
    "55854025",
    "35",
    "50340020",
    "2203",
    "50051688",
    "21",
    "50072686",
    "56392007",
    "50007216",
    "50103282",
    "50010788",
    "50002766",
    "50005998",
    "50482014",
    "50008163",
    "55098010",
    "50039094",
    "50035458",
    "50103280",
    "54164002",
    "55070011",
    "50108542",
    "50097129",
    "50018908",
    "50035978",
    "50010404",
    "50019142",
    "11",
    "50071436",
    "29",
    "50018957",
    "54418001",
    "50015926",
    "50008825",
    "50065355",
    "50005700",
    "50484015",
    "50065207",
    "50096795",
    "50076926",
    "50066661",
    "50040831",
    "50316001",
    "50049318",
    "50018930",
    "20",
    "28",
    "50066173",
    "50007218",
    "55510001",
    "50035182",
    "50019393"
);
foreach($cat_array as $catid){
    $page_now=0;
    $page_all="";
   do{
    $pageoffset=$page_now*45;
    $url="https://kxuan.taobao.com/searchSp.htm?callback=jsonp1341&s=".$pageoffset."&cat=".$catid."&uniq=pid&id=3266&kxuan_swyt_c2c=9158";
    echo $url."\n";
       $res=file_get_contents($url);
      // echo $res;
       $res=str_replace("jsonp1341(","",$res);
       $res=trim($res,")");
       $res=json_decode($res);
       $goods_arr=$res->mods->itemlist->data->auctions;
       $page_all=empty($page_all)?$res->mods->pager->data->totalPage:$page_all;
       foreach ($goods_arr as $goods_item){
           $in_res=insert_goods($goods_item,$catid);
           $timenow=date('Y-m-d H:i:s');
           echo "========= $timenow : $in_res === $page_all ========== \n";
       }

        echo "Page_now:".$page_now."\n";
       $page_now++;
    sleep(2);
   } while($page_now <$page_all);

   //
}

die("\n All done !! \n");


暂无留言,赶快评论吧

欢迎留言