Package org.jsoup.select

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


    Elements elements = select(selector);
    if (elements.size() != 1) {
      String msgPrefix = elements.isEmpty() ? "no" : "more than one";
      throw new WrongSelectorException(msgPrefix + " element found for selector [" + selector + "]");
    }
    return elements.first();
  }


  public String getSource() {
    return source;
View Full Code Here


                    blockingId);
            Elements parentSnippetSearch = doc.select(parentSelector);
            if (parentSnippetSearch.isEmpty()) {
                isBlocked = false;
            } else {
                Element parentSnippet = parentSnippetSearch.first();
                if (parentSnippet.attr(ExtNodeConstants.SNIPPET_NODE_ATTR_STATUS)
                        .equals(ExtNodeConstants.SNIPPET_NODE_ATTR_STATUS_FINISHED)) {
                    isBlocked = false;
                } else {
                    isBlocked = true;
View Full Code Here

                    blockingId);
            Elements parentSnippetSearch = doc.select(parentSelector);
            if (parentSnippetSearch.isEmpty()) {
                isBlocked = false;
            } else {
                Element parentSnippet = parentSnippetSearch.first();
                if (parentSnippet.attr(ExtNodeConstants.SNIPPET_NODE_ATTR_STATUS)
                        .equals(ExtNodeConstants.SNIPPET_NODE_ATTR_STATUS_FINISHED)) {
                    isBlocked = false;
                } else {
                    isBlocked = true;
View Full Code Here

   * Parse the prices from the item description; prices include current price, buy-it-now price, minimum price and US equivalents.
   * @return A hash containing some set of [current, bin, minimum, current_us, bin_us, minimum_us]
   */
  private Record parsePrices() {
    Elements offers = mDocument2.select("[itemprop=offers]");
    if(offers.first() == null) {
      return deprecated.parsePrices(mDocument);
    }

    Record record = new Record();
    String optional_conversion = "";
View Full Code Here

      return deprecated.parsePrices(mDocument);
    }

    Record record = new Record();
    String optional_conversion = "";
    String price = offers.first().select("[itemprop=price]").text();
    String convertedBinPrice = offers.select(".convPrice #binPrice").text();
    String convertedBidPrice = offers.select(".convPrice #bidPrice").text();
    String key = "current";
    boolean minimum = false;
View Full Code Here

    if (endTime.length() == 0) {
      if (parents.isEmpty()) {
        return null;
      }
      endTime = parents.first().text();
    }
    endTime = endTime.replaceAll("([\\(\\s\\)])+", " ").trim();

    ZoneDate endDate = StringTools.figureDate(endTime, T.s("ebayServer.itemDateFormat"), true, true);
View Full Code Here

      }
     
      // text body
      Elements myJrTextBodyElements = myDocument.select("#textbody");
      if (!myJrTextBodyElements.isEmpty()) {
        myTextBody = TextUtil.getInstance().getWholeText(myJrTextBodyElements.first());
      }
     
      // now build the actual message
      MimeMessage myMimeMessage = aMimeMessage;
      // wrap it in a MimeMessageHelper - since some things are easier with that
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.