Package org.jsoup.nodes

Examples of org.jsoup.nodes.Document.select()


    Document doc = Jsoup.parse(content);
    TeamData homeTeam = extractTeam(doc.select("span#bts_1").get(0));
    if (homeTeam == null) {
      return null;
    }
    TeamData awayTeam = extractTeam(doc.select("span#bts_2").get(0));
    if (awayTeam == null) {
      return null;
    }
    LeagueEventData event = new LeagueEventData();
    event.setHomeTeam(homeTeam);
View Full Code Here


      .compile("(?i).*(wczoraj|dzisiaj|jutro|pojutrze).*([0-9]{2}):([0-9]{2}).*");

  @Override
  public List<EventSource> parse(String content) {
    Document doc = Jsoup.parse(content);
    Elements eventDivs = doc.select("div.event-page-card");
    ListIterator<Element> eventsDivsIter = eventDivs.listIterator();
    List<EventSource> eventSources = new ArrayList<EventSource>();

    while (eventsDivsIter.hasNext()) {
      EventSource eventSource = null;
View Full Code Here

    int persisted = 0;
    int merged = 0;
    int skipped = 0;
    int errors = 0;
    BaseDao<IntEvent> dao = daoResolver.resolve(IntEvent.class);
    Elements trs = doc.select("tbody tr");
    for (int i = 0; i < 1; i++) {
      Element tr = trs.get(i);
      Elements tds = tr.select("td");

      String eventUri = tds.get(6).text();
View Full Code Here

       
        Options options = options().templateDir(new File("target/test-classes/src/custom-backends/haml/html5-tweaks")).toFile(false).get();
        String renderContent = asciidoctor.renderFile(new File("target/test-classes/rendersample.asciidoc"), options);
       
        Document doc = Jsoup.parse(renderContent, "UTF-8");
        Element paragraph = doc.select("div.content").first();
        assertThat(paragraph, notNullValue());
    }
   
}
View Full Code Here

        asciidoctor.renderFile(new File(
                "target/test-classes/rendersample.asciidoc"), options);

        Document doc = Jsoup.parse(new File(testFolder.getRoot(),
                "rendersample.html"), "UTF-8");
        Elements link = doc.select("link");
        assertThat(link.get(1).attr("href"), containsString("prettify.min.css"));
       
    }
   
    @Test
View Full Code Here

        asciidoctor.renderFile(new File(
                "target/test-classes/rendersample.asciidoc"), options);

        Document doc = Jsoup.parse(new File(testFolder.getRoot(),
                "rendersample.html"), "UTF-8");
        Elements cssStyle = doc.select("style");
        assertThat(cssStyle.html(), is(not("")));

        Elements link = doc.select("link");
        assertThat(link.html(), is("".trim()));
       
View Full Code Here

        Document doc = Jsoup.parse(new File(testFolder.getRoot(),
                "rendersample.html"), "UTF-8");
        Elements cssStyle = doc.select("style");
        assertThat(cssStyle.html(), is(not("")));

        Elements link = doc.select("link");
        assertThat(link.html(), is("".trim()));
       
    }
   
    @Test
View Full Code Here

        String content = asciidoctor.renderFile(new File(
                "target/test-classes/rendersample.asciidoc"), options);

        Document doc = Jsoup.parse(content, "UTF-8");
        Element anchorElement = doc.select("a[class=anchor]").first();

        assertThat(anchorElement.attr("href"), is("#_section_a"));

    }
View Full Code Here

        asciidoctor.renderFile(new File(
                "target/test-classes/tocsample.asciidoc"), options);

        Document doc = Jsoup.parse(new File(testFolder.getRoot(),
                "tocsample.html"), "UTF-8");
        Elements tocElement = doc.select("div.toc");
        assertThat(tocElement.hasClass("toc"), is(true));

    }

    @Test
View Full Code Here

        asciidoctor.renderFile(new File(
                "target/test-classes/toc2sample.asciidoc"), options);

        File renderedFile = new File(testFolder.getRoot(), "toc2sample.html");
        Document doc = Jsoup.parse(renderedFile, "UTF-8");
        Elements body = doc.select("body");
        String classAttribute = body.attr("class");
        String[] classAttributes = classAttribute.split(" ");
        assertThat(classAttributes, hasItemInArray("toc2"));
        assertThat(classAttributes, hasItemInArray("toc-right"));
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.