سؤال

I am using feedparser to fetch some information from some RSS site(like this site-- 'http://www.huxiu.com/rss/1.xml').

import feedparser

url = 'http://www.huxiu.com/rss/1.xml'
d = feedparser.parse(url)

entries = d.entries
print len(entries)

This print 8.It means I only fetch 8 news from this site.
The question is how to get more news from this site? Can I set the number that to fetch the news,like got 20 news from this site?
Thanks~~~~~

هل كانت مفيدة؟

المحلول

You usually can't get more than what's in a feed at a given time. However, if you subscribe to the feed and keep it in your system long enough, you'll be able to get more and more over time.

نصائح أخرى

No you can't. The number of the fetched news is defined from the Website-provider. You have to parse the RSS daily and check for new content each time. You don't have access to older content from what provider gives access.

We are currently building a service/API to scrape data from any web site. Subscribe for beta testing: http://textract.me/

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top