On Tue, Jul 12, 2011 at 12:20 PM, Subhodip Biswas
<[email protected]>wrote:
>
> I am fairly new to python and i am stuck with a problem.
> What I am trying to do is parse a xml file using minidom. My xml file
> as almost a structure like this :
>
> <someparentabove>
> <parent>
> <child1>
> </child1>
> <child2>
> </child2>
> </parent>
> <anotherparent>
> </anotherparent>
> </someparentabove>
>
> I can get parent along with childs using getElementsByTagName, But is
> there a way I can get only the children (child1 and Child2)?
>
x.getElementsByTagName("parent")[0].childNodes
Btw, you may want to try BeautifulSoup or if you want speed, try :
celementTree.
-V
_______________________________________________
BangPypers mailing list
[email protected]
http://mail.python.org/mailman/listinfo/bangpypers