淘宝天猫店铺商品数据采集



composer require dzer/coltaobao


{{rs.msg}}


依赖

  • PHP 5.3+
  • MYSQL 5.1+
  • MYSQLI PHP Extension
  • CURL PHP Extension

1. 安装

composer require dzer/coltaobao

或者

git clone https://github.com/dzer/coltaobao.git

2. 配置

导入MySQL表 config/coltaobao.sql

设置配置文件 config/config.php

return array(
    //时区
    'timeZone' => 'Asia/Shanghai',
    //资源保存路劲
    'resource' => './resource/coltaobao',
    //日志保存路径
    'log' => './tmp_log/coltaobao',
    //数据库配置信息
    'db' => array(
        'host' => '127.0.0.1',
        'username' => 'root',
        'password' => 'root',
        'db' => 'coltaobao',
        'port' => 3306,
        'prefix' => 'coltaobao_',
        'charset' => 'utf8'
    ),
);

3. 运行

use dzer\coltaobao\ColTaoBao;

ColTaoBao::collect('https://hhtmy.tmall.com/');//传入淘宝或天猫店URL地址