Package org.jsoup.nodes

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


      testHTMLExcelBridge(content);
    }
   
    private static void testHTMLExcelBridge(String content) throws Exception, ExcelException{
      Document doc = Jsoup.parseBodyFragment(content);
      Elements sheets = doc.select("table");
      HTMLExcelBridge heb = new HTMLExcelBridge(sheets);
      heb.reEvaluateAll();
      System.out.println(sheets.toString());
    }
}
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) {
View Full Code Here

    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()));
    }
    tmp = doc.select("title");
    if (tmp != null) {
View Full Code Here

    }
    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

    assumeThat(bodyHtml,notNullValue());
    Document doc = Jsoup.parseBodyFragment(bodyHtml);
    assertTrue(doc!=null);
   
   
    Elements sheets = doc.select("table");
    for(int si=0;si<sheets.size();si++){
      Element sheet = sheets.get(si);
      Elements rows = sheet.select("tbody tr");
      for(int ri=0;ri<rows.size();ri++){
        Element row = rows.get(ri);
View Full Code Here

     * @param args the command line arguments
     * @throws java.io.IOException
     */
    public static void main(String[] args) throws IOException {
        Document doc = Jsoup.connect("http://snooker.org/res/index.asp?event=268").get();
        for (Element event : doc.select("table#event thead")) {
            System.out.println(event.siblingIndex() + " : " + event.className() + " : " + event.html());
        }
    }

    private static void updateEvents() throws IOException {
View Full Code Here

    }

    private static ArrayList<Map<String, Object>> getEvents() throws IOException {
        ArrayList<Map<String, Object>> events = new ArrayList<>();
        Document doc = Jsoup.connect("http://snooker.org/res/index.asp?season=2013&template=2").get();
        for (Element event : doc.select("table#diary tbody tr")) {
            events.add(getEvent(event));
        }
        return events;
    }
View Full Code Here

    Document doc = null;
    try {
      doc = Jsoup.parse(new File(getDefaultLogPath() + ".html"), "UTF-8");
    } catch (IOException e) {
    }
    Element body = doc.select("body").first();
    if (session == 0) {
      session = System.currentTimeMillis();
      body.appendElement("br");
      Element sess = new Element(Tag.valueOf("div"), "", new Attributes());
      sess.addClass("session");
View Full Code Here

      if (s.equals("")) {
        saveLogFile(doc);
        return;
      }
    }
    Element cursession = doc.select("#" + session).first();
    if (cursession == null)
      return;

    Element timestamp = new Element(Tag.valueOf("span"), "",
        new Attributes());
View Full Code Here

public class SFLeagueEventParserV1 implements SFEventParser {

  public LeagueEventData parse(String content) {
    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) {
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.