コード例 #1
0
 /**
  * 得到处于活跃状态的网页爬虫
  *
  * @return
  */
 public static List<Crawler> getActiveWebCrawlerList() {
   List<Crawler> activeCrawlerList = new ArrayList<Crawler>();
   for (Crawler crawler : DataCache.activeCrawlerList) {
     if (crawler.getCrawlerType().indexOf("网页爬虫") != -1) {
       activeCrawlerList.add(crawler);
     }
   }
   return activeCrawlerList;
 }
コード例 #2
0
 /**
  * 选择一个全网爬虫
  *
  * @return
  */
 public static Crawler getWebCrawler() {
   if (activeCrawlerList != null) {
     for (Crawler crawler : activeCrawlerList) {
       if (crawler.getCrawlerType().contains("网爬虫")) {
         return crawler;
       }
     }
   }
   return null;
 }