Package org.jsoup.select

Examples of org.jsoup.select.Elements.text()


    if (tmp != null) {
      this.alias = (new Text(tmp.text()));
    }
    tmp = doc.select("authorName");
    if (tmp != null) {
      this.authorName = (new Text(tmp.text()));
    }
    tmp = doc.select("viewCount");
    if (tmp != null) {
      try {
        DecimalFormat nf = (DecimalFormat) DecimalFormat.getInstance();
View Full Code Here


    tmp = doc.select("viewCount");
    if (tmp != null) {
      try {
        DecimalFormat nf = (DecimalFormat) DecimalFormat.getInstance();
        nf.setDecimalSeparatorAlwaysShown(true);
        Long view = Long.parseLong(tmp.text());
        this.viewCount = (new Text(nf.format(view)));
      } catch (Exception e) {
        this.viewCount = (new Text("1"));
      }
    }
View Full Code Here

        this.viewCount = (new Text("1"));
      }
    }
    tmp = doc.select("totalTime");
    if (tmp != null) {
      this.totalTime = (new Text(tmp.text()));
    }
  }

  /*
   * This method tranform VideoEntry (from Gdata - Youtube api) to Tube
View Full Code Here

  public void transformString(String channelString) {
    Document doc = Jsoup.parse(channelString);
    Elements tmp;
    tmp = doc.select("alias");
    if (tmp != null) {
      this.alias = (tmp.text());
    }
    tmp = doc.select("thumbImageUrl");
    if (tmp != null) {
      this.thumbImageUrl = (new Text(tmp.text()));
    }
View Full Code Here

    if (tmp != null) {
      this.alias = (tmp.text());
    }
    tmp = doc.select("thumbImageUrl");
    if (tmp != null) {
      this.thumbImageUrl = (new Text(tmp.text()));
    }
    tmp = doc.select("title");
    if (tmp != null) {
      this.title = (new Text(tmp.text()));
    }
View Full Code Here

    if (tmp != null) {
      this.thumbImageUrl = (new Text(tmp.text()));
    }
    tmp = doc.select("title");
    if (tmp != null) {
      this.title = (new Text(tmp.text()));
    }
  }

}
View Full Code Here

        String apiContent;

        Elements blocks = document.select(".block");
        if (blocks.size() > 0) {
            apiContent = blocks.text();
        } else {
            apiContent = document.select("p").text();
        }

        SearchEntry entry = new SearchEntry();
View Full Code Here

    }

    @Test public void handlesTextArea() {
        Document doc = Jsoup.parse("<textarea>Hello</textarea>");
        Elements els = doc.select("textarea");
        assertEquals("Hello", els.text());
        assertEquals("Hello", els.val());
    }

    @Test public void preservesSpaceInTextArea() {
        // preserve because the tag is marked as preserve white space
View Full Code Here

    }

    @Test public void handlesTextArea() {
        Document doc = Jsoup.parse("<textarea>Hello</textarea>");
        Elements els = doc.select("textarea");
        assertEquals("Hello", els.text());
        assertEquals("Hello", els.val());
    }

    @Test public void preservesSpaceInTextArea() {
        // preserve because the tag is marked as preserve white space
View Full Code Here

                            }
                        }
                    }
                }else if (n.getTagName().endsWith("()")){
                    //递归执行方法默认只支持text()
                    res.add(context.text());
                }else {
                    Elements searchRes = context.select(n.getTagName());
                    for (Element e:searchRes){
                        Element filterR = filter(e,n);
                        if (filterR!=null){
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.