/// <summary>
 ///  ctor
 /// </summary>
 protected SpiderBuilder()
 {
     _spider = new Spider();
 }
Example #2
0
 /// <summary>
 ///  使用代理池
 /// </summary> 
 public static Spider UseHttpProxyPools(this Spider spider, IHttpProxyFinder proxyFinder)
 {
     return UseHttpProxyPools(spider, proxyFinder, new DefaultProxyValidator(), 5000);
 }
        /// <summary>
        ///  使用NLog 日志组件
        /// </summary>
        public static Spider UseNLog(this Spider spider)
        {
            spider.SetLogFactory(new NLogLoggerFactory());

            return(spider);
        }
Example #4
0
 /// <summary>
 ///  使用代理池
 /// </summary> 
 public static Spider UseHttpProxyPools(this Spider spider, IHttpProxyFinder proxyFinder, int reuseInterval, int refreshInterval = 2 * 1000)
 {
     return UseHttpProxyPools(spider, proxyFinder, new DefaultProxyValidator(), reuseInterval, refreshInterval);
 }
Example #5
0
 /// <summary>
 /// </summary>
 public static Spider AddProcessorConfig(this Spider spider, IConfigResolve resolve)
 {
     return(spider);
 }
Example #6
0
        /// <summary>
        ///  使用NLog 日志组件
        /// </summary>
        public static Spider UseNLog(this Spider spider)
        {
            spider.AddLogProvider(new NLogProvider());

            return(spider);
        }
Example #7
0
        /// <summary>
        ///  使用 Log4net 日志组件
        /// </summary>
        public static Spider UseLog4net(this Spider spider)
        {
            spider.SetLogFactory(new Log4LoggerFactory());

            return(spider);
        }
        /// <summary>
        ///  使用数据库存储日志
        /// </summary>
        public static Spider UseDataBaseLog(this Spider spider, ILoggerWriter loggerWriter)
        {
            spider.AddLogProvider(new LogProvider(loggerWriter));

            return(spider);
        }