Package org.jsoup.nodes

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


        for(int ci=0;ci<cells.size();ci++){
          Element cell = cells.get(ci);
//          System.out.println(cell.toString());
          if(!org.apache.commons.lang.StringUtils.isBlank(cell.text())){
            if(cell.hasAttr("formula")){
              System.out.printf("%d %d %d (Formula[%s]) %s\n",si,ri,ci,cell.attr("formula"),cell.text());
            }else{
              System.out.printf("%d %d %d (Normal ) %s\n",si,ri,ci,cell.text());
            }
           
          }
View Full Code Here


//          System.out.println(cell.toString());
          if(!org.apache.commons.lang.StringUtils.isBlank(cell.text())){
            if(cell.hasAttr("formula")){
              System.out.printf("%d %d %d (Formula[%s]) %s\n",si,ri,ci,cell.attr("formula"),cell.text());
            }else{
              System.out.printf("%d %d %d (Normal ) %s\n",si,ri,ci,cell.text());
            }
           
          }
         
        }
View Full Code Here

          eventSource.setEventUri("www.sportowefakty.pl" + eventUri);
        }
      } else if (eventDiv.select("div.single").size() != 0) {
        // single event
        Element a = eventDiv.select("div.single a").get(0);
        String eventName = a.text();
        String eventUri = a.attr("href");
        if (eventName != null && eventUri != null) {
          eventSource = new EventSource();
          eventSource.setEventName(eventName);
          eventSource.setEventUri("www.sportowefakty.pl" + eventUri);
View Full Code Here

  private Date extractEventDate(Element eventDiv) {
    Elements lis = eventDiv.select("ul.additional li");
    Iterator<Element> liIter = lis.iterator();
    while (liIter.hasNext()) {
      Element li = liIter.next();
      String text = li.text();
      if (StringUtils.isNotBlank(text)) {

        Matcher matcher = pattern.matcher(text);
        if (matcher.matches()) {
View Full Code Here

  }

  private String extractTeam(Element eventDiv, String select) {
    try {
      Element teamA = eventDiv.select(select).get(0);
      String text = teamA.text();
      if (StringUtils.isNotBlank(text)) {
        return text.trim();
      } else {
        return null;
      }
View Full Code Here

      Element catH2 = eventDiv.previousElementSibling();
      while (!catH2.tagName().toLowerCase().equals("h2")) {
        catH2 = catH2.previousElementSibling();
      }
      Element catA = catH2.select("a").get(0);
      String text = catA.text();
      if (StringUtils.isNotBlank(text)) {
        return text.trim();
      } else {
        return null;
      }
View Full Code Here

        String content = asciidoctor.render("The AsciiDoc project is located at http://asciidoc.org.", OptionsBuilder.options().attributes(attributes));

        Document doc = Jsoup.parse(content, "UTF-8");
       
        Element link = doc.getElementsByTag("a").first();
        assertThat(link.text(), is("asciidoc.org"));
       
    }
   
    @Test
    public void compat_mode_should_change_how_document_is_rendered_to_legacy_system() {
View Full Code Here

       
        String content = asciidoctor.render("The `AsciiDoc {version}` project.", OptionsBuilder.options().attributes(attributes));

        Document doc = Jsoup.parse(content, "UTF-8");
        Element code = doc.getElementsByTag("code").first();
        assertThat(code.text(), containsString("{version}"));
       
    }
   
    @Test
    public void no_compat_mode_should_change_how_document_is_rendered_to_new_system() {
View Full Code Here

       
        String content = asciidoctor.render("The `AsciiDoc {version}` project.", OptionsBuilder.options().attributes(attributes));

        Document doc = Jsoup.parse(content, "UTF-8");
        Element code = doc.getElementsByTag("code").first();
        assertThat(code.text(), containsString("1.0.0"));
       
    }
   
    @Test
    public void should_preload_open_cache_uri_gem() throws IOException {
View Full Code Here

        Document doc = Jsoup.parse(new File(testFolder.getRoot(),
                "appendix.html"), "UTF-8");
       
        Element attributeElement = doc.getElementById("_attribute_options");
        assertThat(attributeElement.text(), startsWith("App"));
    }
   
    @Test
    public void should_add_a_hardbreak_at_end_of_each_line_when_hardbreaks_option_is_set() throws IOException {
       
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.