feedparser icon indicating copy to clipboard operation
feedparser copied to clipboard

How to check whether the passed url is a valid rss feed

Open rohitkhatri opened this issue 10 years ago • 4 comments

I'm trying to validate the url, like If I pas feedparser.parse('http://rohitkhatri.com'), It should give me false.

Is there any property which I can access to get this information?

rohitkhatri avatar Dec 02 '16 07:12 rohitkhatri

The number of entries being 0?

On Thu, 1 Dec 2016, 23:53 Rohit Khatri, [email protected] wrote:

I'm trying to validate the url, like If I pas feedparser.parse(' http://rohitkhatri.com'), It should give me false.

Is there any property which I can access to get this information?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kurtmckee/feedparser/issues/86, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGCwMI9c9_rNvWVTHGHo0w7kmdF9ecSks5rD86NgaJpZM4LCSaw .

kevinmarks avatar Dec 02 '16 08:12 kevinmarks

@kevinmarks Yes, no. of entries is zero, will that be fine to validate an rss feed?

rohitkhatri avatar Dec 02 '16 08:12 rohitkhatri

I solved it by checking number of entries, thanks to @kevinmarks :-)

rohitkhatri avatar Dec 05 '16 12:12 rohitkhatri

not sure if correct

d = feedparser.parse('invalid_url')
if d.status != 200:
   invalid_url

tyronexj avatar Apr 09 '21 05:04 tyronexj