code: function(option) {
    var opt = {
      name: option.name || Date.now().toString(),
      path: option.path ? option.path + '/' : '',
      rect: option.rect || webpage.viewportSize
    };
  
    // use clipRect to capture only the area of the specified position
    webpage.clipRect = opt.rect;
  
    webpage.render([options.screenshotPath, opt.path, opt.name, '.png'].join(''), {format: 'png'});
    return option;
  }
docs: Take screenshot of current page