Package org.jsoup.nodes

Examples of org.jsoup.nodes.Element.text()


        Element div = doc.select("div.post-content").first();
        Element title = div.getElementsByTag("a").first();
        channel.write(title.text());
        Element content = div.getElementsByTag("pre").first();
        channel.writeMultiple(content.text().replaceAll("\t", "").split("\n"));
    }
}
View Full Code Here


    @Override
    public LocalDate getData() {
      Element span;
      span = div.getElementById("ctl00_contentPlaceHolderConteudo_ucFundoDetalhes_lblDataCota");

      String data = span.text();
      return forPattern("dd/MM/yyyy").parseLocalDate(data);
    }

    @Override
    public long getQuantidade() {
View Full Code Here

    @Override
    public long getQuantidade() {
      Element span;
      span = div.getElementById("ctl00_contentPlaceHolderConteudo_ucFundoDetalhes_lblValorCota");

      String qtd = span.text();
      qtd = qtd.replaceAll("\\.", "");
      return Long.parseLong(qtd);
    }

  }
View Full Code Here

      String res = "";

      Elements anchors = div.select("span.Dado a");
      if (anchors.size() > 0) {
        Element a = anchors.get(0);
        res = a.text();
      }

      return res.trim();
    }
View Full Code Here

    @Override
    public String getNome() {
      Element span;
      span = div.getElementById("ctl00_contentPlaceHolderConteudo_ucFundoDetalhes_lblNomeFundo");

      return span.text();
    }

    @Override
    public Cnpj getCnpj() {
      try {
View Full Code Here

    public Cnpj getCnpj() {
      try {
        Element span;
        span = div.getElementById("ctl00_contentPlaceHolderConteudo_ucFundoDetalhes_lblCNPJ");

        String cnpj = span.text();
        return Cnpj.valueOf(cnpj);
      } catch (ExcecaoDeCnpjInvalido e) {
        return null;
      }
    }
View Full Code Here

    }

    @Override
    public CategoriaTipo getCategoria() {
      Element td = a.select("td").get(1);
      String name = td.text();
      return CategoriaTipo.valueOrVoid(name);
    }

  }
View Full Code Here

    public Object call(Properties bindings, Object[] args) {
        if (args.length >= 1) {
            Object o1 = args[0];
            if (o1 != null && o1 instanceof Element) {
                Element e1 = (Element)o1;
                return e1.text();

            }else{
                return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " failed as the first parameter is not an HTML Element.  Please first use parseHtml(string) and select(query) prior to using this function");
            }
        }
View Full Code Here

    // update the GUI progress bar
    //Element progress = thisThreadPage.select("a[href=#]:matchesOwn("+pageOfPattern.pattern()+")").first();
    final Element progress = thisThreadPage.select("a[href=#]:matches("+pageOfPattern.pattern()+"), td.nav:matches("+pageOfPattern.pattern()+")").first();
    if (progress != null) {
      System.out.printf("%n" + progress.text().replace("�", "") + "%n"); // Print out the current page
      Matcher pageOfMatcher = pageOfPattern.matcher(progress.text());
      if (pageOfMatcher.find()) {
        double current = Double.parseDouble(pageOfMatcher.group(1));
        double end = Double.parseDouble(pageOfMatcher.group(2));
        //System.out.println(current + " " + end);
View Full Code Here

    // update the GUI progress bar
    //Element progress = thisThreadPage.select("a[href=#]:matchesOwn("+pageOfPattern.pattern()+")").first();
    final Element progress = thisThreadPage.select("a[href=#]:matches("+pageOfPattern.pattern()+"), td.nav:matches("+pageOfPattern.pattern()+")").first();
    if (progress != null) {
      System.out.printf("%n" + progress.text().replace("�", "") + "%n"); // Print out the current page
      Matcher pageOfMatcher = pageOfPattern.matcher(progress.text());
      if (pageOfMatcher.find()) {
        double current = Double.parseDouble(pageOfMatcher.group(1));
        double end = Double.parseDouble(pageOfMatcher.group(2));
        //System.out.println(current + " " + end);
        view.setProgress((int) (current / end * 100));
 
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.