将易趣物品/导入导入ZenCart
16lz
2021-01-22
Just wondering if anybody has done the following, and even point me in the right direction;
只是想知道是否有人做了以下事情,甚至指出了我正确的方向;
- Has anybody exported ebay items from an ebay shop?
- Imported these items into ZenCart
有人从ebay商店出口ebay商品吗?
将这些项目导入ZenCart
Cheers
Shane
2 个解决方案
#1
2
I have created a web scraper using PHP for a similar purpose. It is actually pretty simple. You could scrape the data and write it to the database pretty. Here is a brief excerpt:
为了类似的目的,我使用PHP创建了一个Web scraper。它实际上非常简单。您可以抓取数据并将其写入数据库。这是一个简短的摘录:
function get_web_page( $url )
{
$options = array(
CURLOPT_RETURNTRANSFER => true, // return web page
CURLOPT_HEADER => false, // don't return headers
CURLOPT_FOLLOWLOCATION => true, // follow redirects
CURLOPT_ENCODING => "", // handle all encodings
CURLOPT_USERAGENT => "spider", // who am i
CURLOPT_AUTOREFERER => true, // set referer on redirect
CURLOPT_CONNECTTIMEOUT => 120, // timeout on connect
CURLOPT_TIMEOUT => 120, // timeout on response
CURLOPT_MAXREDIRS => 10, // stop after 10 redirects
);
$ch = curl_init( $url );
curl_setopt_array( $ch, $options );
$content = curl_exec( $ch );
$err = curl_errno( $ch );
$errmsg = curl_error( $ch );
$header = curl_getinfo( $ch );
curl_close( $ch );
//$header['errno'] = $err;
// $header['errmsg'] = $errmsg;
//$header['content'] = $content;
// print($header[0]);
return $content;
}
$content = get_web_page($baseUrl);
$dom = new DOMDocument();
@$dom->loadHTML($content);
$xpath = new DOMXPath($dom);
$hrefs = $xpath->evaluate("/html/body//a");
// $hrefs->length
for ($i = 0; $i < $hrefs->length; $i++) {
$href = $hrefs->item($i);
$url = $href->getAttribute('href');
// process parts and write data to database
}
更多相关文章
- 无法在Yii中更改项目的文件夹名称
- %d和%s的目的是什么?
- 函数参数中裸星号的目的是什么?
- 用于Python项目的低内存和最快查询数据库
- 具有1位条目的numpy布尔数组
- 返回没有匹配条目的所有日期
- Android Studio 项目的导入以及依赖
- 抽象批处理SFTP多目的地和自动重试
- [java混淆器问题] 如何让web项目的class文件不能被反编译,又能在w