Examples of HtmlCleaner


Examples of org.htmlcleaner.HtmlCleaner

  public static void updateVillages( Villages villages) throws Exception
  {
    // 1. get overview/innerview pantalla actual
//    String page = HttpServer.getHttpServer().httpGetPage( "http://s3.travian.net/dorf1.php");
     
    HtmlCleaner cleaner = new HtmlCleaner();
    CleanerProperties props = cleaner.getProperties();
    props.setRecognizeUnicodeChars( true);
        TagNode node = cleaner.clean( new File("tests/overview8.html"));
//        TagNode node = cleaner.clean( page);

        updateVillages2( villages, node);

  }
View Full Code Here

Examples of org.htmlcleaner.HtmlCleaner

  public static Troops getTroops( Village village) throws Exception
  {
    // 1. goto village
    // 2. goto inner village
    // 3. goto rally point
    HtmlCleaner cleaner = new HtmlCleaner();
    TagNode node = cleaner.clean( new File("tests/materias.html"));

    int  numNode = 0;
        Object[] domTroops = node.evaluateXPath( "//div[@id='content']//table");
        for( Object t : domTroops) {
          if( t instanceof TagNode) {
View Full Code Here

Examples of org.htmlcleaner.HtmlCleaner

    {
        // 1. get standard map
        // 2. goto (x,y)
//        String page = HttpServer.getHttpServer().getMapPage( coordX, coordY);
       
        HtmlCleaner cleaner = new HtmlCleaner();
        CleanerProperties props = cleaner.getProperties();
        props.setRecognizeUnicodeChars( true);
        TagNode node = cleaner.clean( new File("tests/karte.htm"));
//        TagNode node = cleaner.clean( page);

        return getSquareUrl2( node);
    }
View Full Code Here

Examples of org.htmlcleaner.HtmlCleaner

    {
        // 1. get overview/innerview pantalla actual
//        String page =  HttpServer.getHttpServer().httpGetPage( url.toString().replace( "&", "&"));
        Thread.sleep( (long) (1000 + 2000*Math.random()));
       
        HtmlCleaner cleaner = new HtmlCleaner();
        CleanerProperties props = cleaner.getProperties();
        props.setRecognizeUnicodeChars( true);
        TagNode node = cleaner.clean( new File("tests/karte_village.htm"));
//        TagNode node = cleaner.clean( page);

        return getSquareType2( node);

    }
View Full Code Here

Examples of org.htmlcleaner.HtmlCleaner

    recherche(source);
  }
 
  public void recherche(String lien) throws MalformedURLException, IOException, XPatherException
  {
    HtmlCleaner cleaner = new HtmlCleaner();
    TagNode node = cleaner.clean(new URL(lien));
    info = new String();
    int count = 0;
   
    for (Object o : node.evaluateXPath("//body//p"))
    {
View Full Code Here

Examples of org.htmlcleaner.HtmlCleaner

    props.setAdvancedXmlEscape(true);
    props.setTransResCharsToNCR(true);
    props.setTranslateSpecialEntities(true);
    props.setTransSpecialEntitiesToNCR(true);
   
    HtmlCleaner cleaner = new HtmlCleaner(props);
     
    TagNode node = cleaner.clean(new URL(lien));
    //System.out.println("Title: " + ((TagNode)(node.evaluateXPath("//title")[0])).getText());
    for (Object o : node.evaluateXPath("//ul[@id='acces_1']//li/a"))
    {
      String dUrl = ((TagNode)(o)).getAttributeByName("href");
      //System.out.println("LI: " + org.apache.commons.lang3.StringEscapeUtils.unescapeHtml4(((TagNode)(o)).getText().toString()));
View Full Code Here

Examples of org.htmlcleaner.HtmlCleaner

    props.setTranslateSpecialEntities(true);
    props.setTransResCharsToNCR(true);
    props.setTransSpecialEntitiesToNCR(true);
    props.setOmitComments(true);
     
    HtmlCleaner cleaner = new HtmlCleaner(props);

    TagNode node = cleaner.clean(new URL(lien));
   
    for (Object o : node.evaluateXPath("//div[@id='retour_accueil']/a/img"))
    {
      //System.out.println(((TagNode)(o)).getAllChildren());
      lien_logo = ((TagNode)(o)).getAttributeByName("src");
View Full Code Here

Examples of org.htmlcleaner.HtmlCleaner

    props.setTranslateSpecialEntities(true);
    props.setTransResCharsToNCR(true);
    props.setTransSpecialEntitiesToNCR(true);
    props.setOmitComments(true);
     
    HtmlCleaner cleaner = new HtmlCleaner(props);
     
    int i=0;
    TagNode node = cleaner.clean(new URL(lien));
   
    for (Object o : node.evaluateXPath("//div[@class='encadre_fiche firstencadre']/div/div/a"))
    {
      lien_site_spe = ((TagNode)(o)).getAttributeByName("href");
      //System.out.println("lien spe "+lien_site_spe);
View Full Code Here

Examples of org.htmlcleaner.HtmlCleaner

  }
 
 
  public boolean recherche(String mot, String lien) throws MalformedURLException, IOException, XPatherException
  {
    HtmlCleaner cleaner = new HtmlCleaner();
    TagNode node = cleaner.clean(new URL(lien));
    boolean bool = false;

    String[] decoupage = mot.split(" ");
    if(decoupage.length == 1)
    {
View Full Code Here

Examples of org.htmlcleaner.HtmlCleaner

    }
    return new Template(mapping);
  }
 
  private static HtmlCleaner getCleaner() {
    HtmlCleaner cleaner = new HtmlCleaner();
    cleaner.getProperties().setTranslateSpecialEntities(false);
    cleaner.getProperties().setRecognizeUnicodeChars(false);
    cleaner.getProperties().setUseEmptyElementTags(false);
    return cleaner;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.