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 417045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T18:32:27+00:00 2026-05-12T18:32:27+00:00

I like Python, but I don’t want to write 10 lines just to get

  • 0

I like Python, but I don’t want to write 10 lines just to get an attribute from an element. Maybe it’s just me, but minidom isn’t that mini. The code I have to write in order to parse something using it looks a lot like Java code.

Is there something that is more user-friendly ? Something with overloaded operators, and which maps elements to objects?

I’d like to be able to access this :


<root>
<node value="30">text</node>
</root>

as something like this :


obj = parse(xml_string)
print obj.node.value

and not using getChildren or some other methods like that.

  • 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-12T18:32:28+00:00Added an answer on May 12, 2026 at 6:32 pm

    You should take a look at ElementTree. It’s not doing exactly what you want but it’s a lot better then minidom. If I remember correctly, starting from python 2.4, it’s included in the standard libraries. For more speed use cElementTree. For more more speed (and more features) you can use lxml (check the objectify API for your needs/approach).

    I should add that BeautifulSoup do partly what you want. There’s also Amara that have this approach.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'd like to generate documentation via reST, but don't want to write the reST
I want to use python's (2.6.5) ctypes with cygwin, but I don't know how
Is there something like python's interactive REPL mode, but for Java? So that I
I would like to call python script files from my c++ program. I am
I try Netbeans 6.7 for python but don't have a good django template highlight
I'm sorry to have to ask something like this but python's mechanize documentation seems
I'd like to start creating Android apps but I don't like Java. I read
We're considering using Python (IronPython, but I don't think that's relevant) to provide a
I would like to get a sum from a column, with and without a
I'm trying to convert a simple C program into Python but as I don't

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.