Open qizhenchao opened 2 years ago
看了看源码,我觉得这里可以处理一下。 我可以改吗:)
$exists = queue::exists($key);
// 不存在或者当前URL可重复入
if (!$exists || $allowed_repeat)
{
// 待爬取网页记录数加一
queue::incr('collect_urls_num');
// 先标记为待爬取网页
queue::set($key, time());
// 入队列
$link = json_encode($link);
//根据采集设置为顺序采集还是随机采集,使用列表或集合对象 2018-5 BY KEN <a-site@foxmail.com>
if (self::$configs['queue_order'] == 'rand')
{
queue::sadd('collect_queue', $link);
}
else
{
queue::lpush('collect_queue', $link);
}
$status = true;
}
看了看源码,我觉得这里可以处理一下。 我可以改吗:)
$exists = queue::exists($key); // 不存在或者当前URL可重复入 if (!$exists || $allowed_repeat) { // 待爬取网页记录数加一 queue::incr('collect_urls_num'); // 先标记为待爬取网页 queue::set($key, time()); // 入队列 $link = json_encode($link); //根据采集设置为顺序采集还是随机采集,使用列表或集合对象 2018-5 BY KEN <a-site@foxmail.com> if (self::$configs['queue_order'] == 'rand') { queue::sadd('collect_queue', $link); } else { queue::lpush('collect_queue', $link); } $status = true; }
可以呀, 改完给我提一个patch即可啊
在用回调函数on_list_page去获得列表页数据时候, $options = array( 'method' => 'get', 'context_data' => $page_views, );
这个方法不生效, 无法在content 页获得这个options 里的信息。 我猜想是这个$content_url已经在url列表里了, 无法重复再加入。
请问怎么解决这个问题?