public static void main(String[] args) throws IOException {
// TODO code application logic here
Document doc = Jsoup.connect("http://jkbose.nic.in/results/").get();
Element table = doc.select("table").get(0); //select the first table.
Elements rows = table.select("tr");
for (int i = 1; i < rows.size(); i++) { //first row is the col names so skip it.
Element row = rows.get(i);
Elements cols = row.select("a");
for (Element e : cols){
String title = e.text();
String url = e.absUrl("href");
System.out.println("NAME: " + title + "\nURL: " + url + "\n\n");
}
}
}
https://jkbose.nic.in/DateSheets.html
public static void main(String[] args) throws IOException {
Document doc = Jsoup.connect("https://jkbose.nic.in/DateSheets.html").get();
Element table = doc.select("table").get(0); //select the first table.
Elements rows = table.select("tr");
for (int i = 1; i < rows.size(); i++) { //first row is the col names so skip it.
Element row = rows.get(i);
Elements cols = row.select("a");
for (Element e : cols){
String title = e.text();
String url = e.absUrl("href");
System.out.println("NAME: " + title + "\nURL: " + url + "\n\n");
}
}
}
public class JavaApplication1 {
public static void main(String[] args) throws IOException {
Document doc = Jsoup.connect("http://jkpsc.nic.in/").get();
Element ul = doc.getElementById("whatsNew");
Elements li = ul.select("a");
for (Element e : li) {
String name = e.text();
String url = e.absUrl("href");
if (!url.equals("http://jkpsc.nic.in/") && !name.isEmpty()){
System.out.print("\n\nNAME: " + name + "\nURL: " + url);
}
// if (name!=null || url!=null && ! name.equals("") || !name.equals("http://jkpsc.nic.in/")){
// System.out.print("\n\nNAME: " + name + "\nURL: " + url);
// }
}
}
}
https://www.kashmiruniversity.net/notifications.aspx
public class JavaApplication1 {
public static void main(String[] args) throws IOException {
Document doc = Jsoup.connect("https://www.kashmiruniversity.net/notifications.aspx").get();
Element ul = doc.getElementById("lstNewsAndAnnouncements");
Elements li = ul.select("a");
for (Element e : li) {
String name = e.text();
String url = e.absUrl("href");
if (name!=null || url!=null){
System.out.print("\n\nNAME: " + name + "\nURL: " + url);
}
}
}
}