Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/video/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 无法创建线程管道:CasperJS上打开的文件太多_Javascript_Error Handling_Phantomjs_Casperjs - Fatal编程技术网

Javascript 无法创建线程管道: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

我已经制作了一个CasperJS脚本来获取来自多个链接的所有图像。当我运行它时,它会运行几分钟,然后抛出这个错误

我不知道如何解决这个问题

我的CasperJS脚本:

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时的第一个结果)