Package org.jsoup.nodes

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


    try {
      firstTagStartsWith(doc, "th", "Tourney ", bSilent);
      firstTagMatches(doc, "td.board", "Board [0-9]+ traveller", bSilent);
      // as a fallback get the numeric title
      Element th = getFirstTag(doc, "th", true);
      m_sTitle = th.text();
      m_sTitle = m_sTitle.replaceFirst("Tourney ", "");
      m_sTitle = m_sTitle.replaceFirst("-$", "");
      getBetterTitle();
      if (f.isDebugMode()) m_ow.addLine(m_sTitle);
      setDirNameFromTitle();
View Full Code Here


  protected void firstTagStartsWith(Element parent, String sTag,
    String sStart, boolean bSilent)
    throws DownloadFailedException
  {
    Element first = getFirstTag(parent, sTag, bSilent);
    if (!first.text().startsWith(sStart))
      throw new DownloadFailedException(
        PbnTools.getStr("error.tagStarts", sTag, sStart, first.text()),
        m_ow, !bSilent);
  }
 
View Full Code Here

    throws DownloadFailedException
  {
    Element first = getFirstTag(parent, sTag, bSilent);
    if (!first.text().startsWith(sStart))
      throw new DownloadFailedException(
        PbnTools.getStr("error.tagStarts", sTag, sStart, first.text()),
        m_ow, !bSilent);
  }
 
  /** Checks if text of first <code>sTag</code> starts with the given text.
    * If not, throws exception.
View Full Code Here

  protected void firstTagMatches(Element parent, String sTag,
    String sMatch, boolean bSilent)
    throws DownloadFailedException
  {
    Element first = getFirstTag(parent, sTag, bSilent);
    if (!first.text().matches(sMatch))
      throw new DownloadFailedException(
        PbnTools.getStr("error.tagMatches", sTag, sMatch, first.text()),
        m_ow, !bSilent);
  }
  // }}} JSoup methods
View Full Code Here

    throws DownloadFailedException
  {
    Element first = getFirstTag(parent, sTag, bSilent);
    if (!first.text().matches(sMatch))
      throw new DownloadFailedException(
        PbnTools.getStr("error.tagMatches", sTag, sMatch, first.text()),
        m_ow, !bSilent);
  }
  // }}} JSoup methods
 
  /** Returns the card color corresponding to the given img tag element.
View Full Code Here

  /** check whether only one given tag exists and matches <code>sTextReg</code> */
  protected boolean checkTagText(Element parent, String sTag, String sTextReg, boolean bSilent)
  {
    Element elem = getOneTag(parent, sTag, bSilent);
    if (elem == null) { return false; }
    String sText = elem.text();
    sText = sText.replace('\u00a0', ' ');
    if (!sText.matches(sTextReg)) {
      println(PbnTools.getStr("error.invalidTagValue", sTag, sTextReg, elem.text()));
      return false;
    }
View Full Code Here

    Element elem = getOneTag(parent, sTag, bSilent);
    if (elem == null) { return false; }
    String sText = elem.text();
    sText = sText.replace('\u00a0', ' ');
    if (!sText.matches(sTextReg)) {
      println(PbnTools.getStr("error.invalidTagValue", sTag, sTextReg, elem.text()));
      return false;
    }
    return true;
  }
 
View Full Code Here

    if (title == null) {
      if (!bSilent || f.isDebugMode())
        m_ow.addLine(
          PbnTools.getStr("error.oneTagExpected", "h4", " (wyn.html)"));
    }
    m_sTitle = title.text();

    try {
      getNumberOfDeals(m_doc, bSilent);
    }
    catch (DownloadFailedException dfe) {
View Full Code Here

  protected String parseDocument(Document document) {
    Element element = document.select(
        "table.product > tbody > tr > td > b.priceLarge").first();

    if (element != null) {
      String[] parts = element.text().split("\\s", 2);

      if (parts.length == 1) {
        return parts[0];
      }
View Full Code Here

  @Override
  protected String parseDocument(Document document) {
    Element element = document.select("ul.mint > li.price").first();

    if (element != null) {
      String[] parts = element.text().split("\\s", 2);

      if (parts.length == 1) {
        return parts[0];
      }
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.