Need your help. The parser of news pages through JS0UP, in one of the news there is no link - and the project crashes. How can I set a link by silence or link substitution if (linkHref) does not receive data?
Elements table = doc.select("table[style]"); arraylist.clear(); for(Element row: table) { HashMap<String, String> map = new HashMap<String, String>(); Element jink = row.select("td[style]").first(); Element xHref = row.select("td[align]").first(); Element link = jink.select("a").first(); String linkHref = link.attr("href"); map.put("news", jink.text()); map.put("date", xHref.text()); map.put("link", "http://сайт.ru/news.php?id=" + linkHref.substring(16)); // Set all extracted Jsoup Elements into the array arraylist.add(map);