Advertisement
Guest User

Untitled

a guest
Jul 19th, 2016
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. public class helloS {
  2. //вот этот статичный лист - то, что надо для выбора на клик(ссылка)
  3. public static ArrayList<String>list1OfLinks() throws IOException{
  4. ArrayList<String>list = new ArrayList<String>();
  5. Document doc = Jsoup.connect("http://blackcub.ru/category/analytics").get();
  6. Elements links = doc.select("a");
  7. for(Element link : links){
  8. String s = link.attr("abs:href");
  9. if(s.contains("2016")){
  10. list.add(s);
  11. Set<String> hs = new LinkedHashSet<>();
  12. hs.addAll(list);
  13. list.clear();
  14. list.addAll(hs);
  15. }
  16.  
  17. }
  18. return list;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement