Guest User

Untitled

a guest
Jul 17th, 2016
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. public static void main(String[] args) throws IOException {
  2. ArrayList <String> list = new ArrayList<String>();
  3.  
  4. Document doc = Jsoup.connect("http://blackcub.ru/category/analytics").get();
  5. Elements links = doc.select("a");
  6. for(Element link : links){
  7. String s = link.attr("abs:href");
  8. for(int i = 0;i<11;i++){
  9. if(s.contains("2016")){
  10. list.add(s);
  11. Set<String> hs = new HashSet<>();
  12. hs.addAll(list);
  13. list.clear();
  14. list.addAll(hs);
  15. }
  16. }
  17. }
  18. for(int i = 0;i<list.size();i++){
  19. System.out.println(list.get(i));
  20. }
  21. }
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment