sajad
sajad

Reputation: 2174

java: find RSS file(s) of a website

I am writing a java application; using Rome lib for reading RSS feeds of a RSS file of a website. I can read and manage feeds using Rome but I can not find the exact URL path of RSS file. I know there is a line like this in html file specifying the RSS xml file url:

<link rel="alternate" type="application/rss+xml" href="/rss.ashx" title="Rss feed for yourdomain.com" />

what is a clean way to find RSS file, url path in java?

thank you all

Upvotes: 2

Views: 1294

Answers (1)

ercpe
ercpe

Reputation: 312

You could use a xpath expression on the html page to get the <link />-Node and extract the href attribute. Out of the box this will only work on wellformed XHTML pages. Maybe you need to fix the document before applying the xpath.

Or you use something like http://jsoup.org/

Upvotes: 3

Related Questions