【发布时间】:2014-09-08 13:43:32
【问题描述】:
您好,我一直在尝试使用此代码在 opencart 中对从 order_id=1 到 order_id=10 的所有订单进行数据抓取
<?php
$url = 'http://www.myopencartstore.com/admin/index.php?route=sale/order/info&token=97d9e2f96bb321a6f3506834d6f082e7&order_id=1';
$content = file_get_contents($url);
$first_step = explode( '<div class="llst-item-address">' , $content );
$second_step = explode("</div>" , $first_step[0] );
print_r ($second_step);
?>
但它看到 opencart 管理员只是自动将我注销,我也尝试过
https://import.io/ a web scrapping tool
它适用于所有带有查询字符串的网站,但是当我将它与 OPENCART ADMIN 一起使用时,它只会让我退出我知道你可以使用数据库执行此操作,但店主告诉我这样做你能帮忙吗
【问题讨论】:
-
你需要cookie支持,这一般意味着使用curl而不是file_get_contents
-
@user574632 我该怎么做
-
当你能用数据库做到这一点时,这样做很荒谬
-
@JayGilford 哈,我知道,但我们的网站所有者希望我这样做,你知道怎么做吗
-
看起来像 我的客户想要那样,所以我不假思索地这样做的另一个案例,而且 我是一个完全的菜鸟,但我有很多客户那为什么不。这些天越来越频繁地发生。可能是什么病?希望我不会被它感染...
标签: php web-scraping opencart screen-scraping