Javascript 无法创建线程管道:CasperJS上打开的文件太多
我已经制作了一个CasperJS脚本来获取来自多个链接的所有图像。当我运行它时,它会运行几分钟,然后抛出这个错误 我不知道如何解决这个问题 我的CasperJS脚本:Javascript 无法创建线程管道:CasperJS上打开的文件太多,javascript,error-handling,phantomjs,casperjs,Javascript,Error Handling,Phantomjs,Casperjs,我已经制作了一个CasperJS脚本来获取来自多个链接的所有图像。当我运行它时,它会运行几分钟,然后抛出这个错误 我不知道如何解决这个问题 我的CasperJS脚本: casper.repeat(200, function() { casper.thenOpen('http://google.fr/', function() { // Get a new page res = this.evaluate(function(wsurl) { retu
casper.repeat(200, function() {
casper.thenOpen('http://google.fr/', function() { // Get a new page
res = this.evaluate(function(wsurl) {
return JSON.parse(__utils__.sendAJAX(wsurl, 'POST', null, false));
}, {wsurl: ajax_url});
});
casper.then(function(){
this.wait(1000);
})
casper.then(function(){
this.open(res.source); // Open it
});
casper.then(function(){
this.wait(1000);
});
casper.then(function(){
arr_img = this.getElementsAttribute('img', 'src');
});
casper.then(function(){
arr_img.forEach(function(value, key){ // Grab the images
var img = new Image();
img.src = value;
if(img.width >= 337){
temp = {};
temp['image'] = value;
temp['width'] = img.width;
temp['height'] = img.height;
arr.push(temp);
}
delete window.img;
});
});
casper.then(function(){
require('utils').dump(arr);
// Save the array
});
casper.then(function(){
this.clear();
});
});
我的错误:
QEventDispatcherUNIXPrivate(): Unable to create thread pipe: Too many open files
2014-09-20T15:37:27 [FATAL] QEventDispatcherUNIXPrivate(): Can not continue without a thread pipe
Abort trap: 6
可能重复(在Google上搜索phantomjs QEventDispatcherUNIXPrivate时的第一个结果)