Package com.iqbon.spider.domain

Examples of com.iqbon.spider.domain.Record


    }
  }

  @Test
  public void testGetCrawlContentBySourceAndUrl() {
    Record record = controller.getCrawlContentBySourceAndUrl(
        "http://home.163.com/13/0119/10/8LJ06D77001048P8.html", sourceUrl);
    logger.info(ToStringBuilder.reflectionToString(record));
  }
View Full Code Here


    recordDao.insertRecordList(list);
  }

  @Test
  public void testQueryRecordByUrl() {
    Record r = recordDao.queryRecordByUrl(record.getUrl());
    logger.info(ToStringBuilder.reflectionToString(r));
  }
View Full Code Here

    logger.info(ToStringBuilder.reflectionToString(r));
  }

  @Test
  public void testUpdateContentById() {
    Record r = recordDao.queryRecordByUrl(record.getUrl());
    r.setContent("after test");
    recordDao.updateContentById(r.getId(), r.getContent());
  }
View Full Code Here

                  replace.getReplacement());
            }
          }
          String sourceId = source.getId().toString();
          String title = document.title();
          return new Record(title, url, recordContent, sourceId);
        }
      }
      EntityUtils.consume(entity);
      return null;
    } catch (Exception e) {
View Full Code Here

  public void run() {
    List<Record> records = new ArrayList<Record>();
    List<String> links = crawlService.getLinkFromSource(source);
    for (String url : links) {
      Record record = crawlService.getContentFromLink(url, source);
      if (record != null) {
        records.add(record);
      }
    }
    recordDao.insertRecordList(records);
View Full Code Here

  }

  @Test
  public void testGetContentFromLink() {
    Source source = sourceDao.querySourceByUrl(URL);
    Record record = crawlService.getContentFromLink(
        "http://home.163.com/13/0123/18/8LU3QD5700104JVC.html", source);
    logger.info(ToStringBuilder.reflectionToString(record));
  }
View Full Code Here

TOP

Related Classes of com.iqbon.spider.domain.Record

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.