Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 29th, 2012  |  syntax: None  |  size: 1.11 KB  |  hits: 19  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. counting child tags inside the parent tag
  2. <div class="pagination">
  3. <div class="label">Page: </div>
  4. <div class="button selected" onclick="$('.page-position', $(this).closest('form')).attr('value', $(this).html()); $(this).closest('form').submit();">1</div>
  5. <div class="button " onclick="$('.page-position', $(this).closest('form')).attr('value', $(this).html()); $(this).closest('form').submit();">2</div>
  6. <div class="button " onclick="$('.page-position', $(this).closest('form')).attr('value', $(this).html()); $(this).closest('form').submit();">3</div>
  7. <div class="button" onclick="$('.page-position', $(this).closest('form')).attr('value', 2);$(this).closest('form').submit();">Next</div>
  8. </div>
  9.        
  10. Document doc = Jsoup.parse(input);
  11.        
  12. Document doc = Jsoup.connect("http://url").get();
  13.        
  14. Elements els = doc.select("div.pagination div").not(":contains(Next)").not(":contains(Page)");
  15.        
  16. Elements els = doc.select("div.pagination div:matches(\d+)");
  17.        
  18. els.size();
  19.        
  20. alert ($('.pagination div').not($("div:contains('Next')")).length);
  21.        
  22. var total = $('.pagination div.button').not(':contains("Next")').size();
  23. alert(total);