Package org.jsoup.select

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


        String h = "<div><foo title=bar>Hello<foo title=qux>there</foo></div>";
        Document doc = Jsoup.parse(h);
        Elements foos = doc.select("foo");
        assertEquals(2, foos.size());
        assertEquals("bar", foos.first().attr("title"));
        assertEquals("qux", foos.last().attr("title"));
        assertEquals("there", foos.last().text());
    }

    @Test public void handlesUnknownInlineTags() {
        String h = "<p><cust>Test</cust></p><p><cust><cust>Test</cust></cust></p>";
View Full Code Here


        Document doc = Jsoup.parse(h);
        Elements foos = doc.select("foo");
        assertEquals(2, foos.size());
        assertEquals("bar", foos.first().attr("title"));
        assertEquals("qux", foos.last().attr("title"));
        assertEquals("there", foos.last().text());
    }

    @Test public void handlesUnknownInlineTags() {
        String h = "<p><cust>Test</cust></p><p><cust><cust>Test</cust></cust></p>";
        Document doc = Jsoup.parseBodyFragment(h);
View Full Code Here

        key = "bin";
        optional_conversion = convertedBinPrice;
      }
    } else if(offers.size() == 2) {
      // If there are 2 offers, the last is the Buy-It-Now amount and the first is the minimum bid amount.
      record.put("bin", offers.last().select("[itemprop=price]").text());
      if (convertedBinPrice.length() != 0) record.put("bin_us", convertedBinPrice);

      minimum = true;
      optional_conversion = convertedBidPrice;
    }
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.