我是CasperJS的初学程序员,我正在编写一个收集网站上每个链接的爬虫,我希望根据内容类型下载。
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="InternalClass.cs" company="TestCompany">
// MS-PL
// </copyright>
// --------------------------------------------------------------------------------------------------------------------
namespace ConsoleApplication10
{
/// <summary>
/// Test internal class.
/// </summary>
internal class InternalClass
{
/// <summary>
/// Gets or sets a value indicating whether the property one.
/// </summary>
internal bool Property1 { get; set; }
/// <summary>
/// Gets the property two.
/// </summary>
internal int Property2 { get; private set; }
}
}
答案 0 :(得分:0)
casper.on("resource.received", function(response){
"use strict";
resourcesRec.push(response);
var file = response.url.replace(/^.*[\\\/]/, '');
casper.download(response.url,file);
});