Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 59807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T18:03:47+00:00 2026-05-10T18:03:47+00:00

According to the feedparser documentation , I can turn an RSS feed into a

  • 0

According to the feedparser documentation, I can turn an RSS feed into a parsed object like this:

import feedparser d = feedparser.parse('http://feedparser.org/docs/examples/atom10.xml') 

but I can’t find anything showing how to go the other way; I’d like to be able do manipulate ‘d’ and then output the result as XML:

print d.toXML() 

but there doesn’t seem to be anything in feedparser for going in that direction. Am I going to have to loop through d’s various elements, or is there a quicker way?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T18:03:48+00:00Added an answer on May 10, 2026 at 6:03 pm

    Appended is a not hugely-elegant, but working solution – it uses feedparser to parse the feed, you can then modify the entries, and it passes the data to PyRSS2Gen. It preserves most of the feed info (the important bits anyway, there are somethings that will need extra conversion, the parsed_feed[‘feed’][‘image’] element for example).

    I put this together as part of a little feed-processing framework I’m fiddling about with.. It may be of some use (it’s pretty short – should be less than 100 lines of code in total when done..)

    #!/usr/bin/env python import datetime  # http://www.feedparser.org/ import feedparser # http://www.dalkescientific.com/Python/PyRSS2Gen.html import PyRSS2Gen  # Get the data parsed_feed = feedparser.parse('http://reddit.com/.rss')  # Modify the parsed_feed data here  items = [     PyRSS2Gen.RSSItem(         title = x.title,         link = x.link,         description = x.summary,         guid = x.link,         pubDate = datetime.datetime(             x.modified_parsed[0],             x.modified_parsed[1],             x.modified_parsed[2],             x.modified_parsed[3],             x.modified_parsed[4],             x.modified_parsed[5])         )      for x in parsed_feed.entries ]  # make the RSS2 object # Try to grab the title, link, language etc from the orig feed  rss = PyRSS2Gen.RSS2(     title = parsed_feed['feed'].get('title'),     link = parsed_feed['feed'].get('link'),     description = parsed_feed['feed'].get('description'),      language = parsed_feed['feed'].get('language'),     copyright = parsed_feed['feed'].get('copyright'),     managingEditor = parsed_feed['feed'].get('managingEditor'),     webMaster = parsed_feed['feed'].get('webMaster'),     pubDate = parsed_feed['feed'].get('pubDate'),     lastBuildDate = parsed_feed['feed'].get('lastBuildDate'),      categories = parsed_feed['feed'].get('categories'),     generator = parsed_feed['feed'].get('generator'),     docs = parsed_feed['feed'].get('docs'),      items = items )   print rss.to_xml() 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 114k
  • Answers 114k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer $(function() { $("span.balloon").hide(); $("span.ballooned[balloonid]").mouseover( function() { var balloonid = "#"… May 11, 2026 at 10:18 pm
  • Editorial Team
    Editorial Team added an answer Normally you would pass the model object you are editing… May 11, 2026 at 10:18 pm
  • Editorial Team
    Editorial Team added an answer I managed this by using adjacency lists. Each cell will… May 11, 2026 at 10:18 pm

Related Questions

According to the manual , git dcommit will create a revision in SVN for
According to the documentation, they're pretty much interchangeable. Is there a stylistic reason to
According to the answers to this question, I cannot embed a file version in
According to the MSDN, the BaseDirectory is where an AppDomain will look for DLLs

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.