PHP code example of netwolf103 / ecommerce-taobao

1. Go to this page and download the library: Download netwolf103/ecommerce-taobao library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

netwolf103 / ecommerce-taobao example snippets



Netwolf103\Ecommerce\Taobao\Collection;
use Netwolf103\Ecommerce\Taobao\Product\Product;
use Netwolf103\Ecommerce\Taobao\Product\Images;
use Netwolf103\Ecommerce\Taobao\Product\Attribute;

$varDir = sprintf('%s/var', dirname(__FILE__));
$csvDir = sprintf('%s/1688', $varDir);
$productHtml = 'demo.html';

$collection = new Collection($productHtml, new Product(new Images, new Attribute));
$collection
	->parse()
	->saveCsv(sprintf('%s/%s.csv', $csvDir, $collection->getProduct()->getSku()))
;