I am trying to get RSS link from html source code. I used Jsoup java library to find rss link. I wrote a small piece of code to get RSS links, but unfortunately it is not working for all the websites. Below is my code
String url = "http://www.smashingmagazine.com/"; // not working
Document doc = Jsoup.connect(url).get();
Elements links = doc.select("link[type=application/rss+xml]");
if (links.size() > 0) {
String rss_url = links.get(0).attr("href").toString();
} else {
// RSS url not found
}
The above code is not working for all the websites. Please solve my problem. (I am trying to find RSS 2.0 links)
Thank You
RSS parser like Rome
. The above process can be repeated pretty much with any site that provide RSS feeds. – RanRag May 27 '12 at 7:19application/rss+xml
instead it hasapplication/atom+xml
– RanRag May 27 '12 at 7:32application/rss+xml
is present still i am not getting rss url. – user911236 May 27 '12 at 7:37dtscinema.com
b'coz when I am trying to open it from here it seems the domain has expired. – RanRag May 27 '12 at 7:42