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

  • SEARCH
  • Home
  • 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 7441973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:06:10+00:00 2026-05-29T11:06:10+00:00

So, in my last question I asked for help in parsing the links from

  • 0

So, in my last question I asked for help in parsing the links from XML in an RSS feed. Using the ideas I received from assistance here in combination with extra research, I was able to write up this:

def GetRSS(RSSurl):
    url_info = urllib.urlopen(RSSurl)
    if (url_info):
        xmldoc = minidom.parse(url_info)
    if (xmldoc):
        channel = xmldoc.getElementsByTagName('channel')
        for node in channel:
            item = xmldoc.getElementsByTagName('item')
            for node in item:
                alist = xmldoc.getElementsByTagName('link')
                for a in alist: 
                    linktext = a.firstChild.data
                    print linktext

As I mentioned in the other question, I wrote this for obtaining the links from the RSS feed on Redlettermedia.com. The code works fine and the output I receive is:

http://redlettermedia.com
http://redlettermedia.com/half-in-the-bag-b-fest-2012/
http://redlettermedia.com/an-update-from-red-letter-media/
http://redlettermedia.com/half-in-the-bag-red-tails/
http://redlettermedia.com/half-in-the-bag-the-devil-inside-and-flyin-ryan/
http://redlettermedia.com/newly-found-episode-iii-review-behind-the-scenes-footage/
http://redlettermedia.com/half-in-the-bag-the-girl-with-the-dragon-tattoo-and-2011-re-cap/
http://redlettermedia.com/mr-plinetts-indiana-jones-and-the-kingdom-of-the-crystal-skull-review/
http://redlettermedia.com/new-mr-plinkett-review-trailer/
http://redlettermedia.com/plinkett-fest/
http://redlettermedia.com/update/
http://redlettermedia.com
http://redlettermedia.com/half-in-the-bag-b-fest-2012/
http://redlettermedia.com/an-update-from-red-letter-media/
http://redlettermedia.com/half-in-the-bag-red-tails/
http://redlettermedia.com/half-in-the-bag-the-devil-inside-and-flyin-ryan/
http://redlettermedia.com/newly-found-episode-iii-review-behind-the-scenes-footage/

And so on. What I would like to do now is print only the newest update link as a result for a function (which is the second line in the output, “http://redlettermedia.com/half-in-the-bag-b-fest-2012/” in this case). How would I print only that line?

  • 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. Editorial Team
    Editorial Team
    2026-05-29T11:06:18+00:00Added an answer on May 29, 2026 at 11:06 am

    If it’s always the second item in the list you could try

    url = xmldoc.getElementsByTagName('link')[1].firstChild.data
    print url
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my last question I asked about parsing the links out of an HTML
Following from my last question which @Jon Skeet gave me a lot of help
i had asked help on this question here Static member reclaiming memory and recovering
Ok, I asked a question last night and received a number of really great
last time i was on here, the only question i needed help with in
I guess this is a continuation of the last question I asked: bulk insert
This is similar to this question I asked last week. My dataGrid is populated
I previously asked a question about fetching the last 100 mentions for a person
My last question wasn't explained very well. What I'm trying to do here is
Because I asked wrong question last time , I want to correct my intention.

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.