Prev: tone generation for motherboard and sound card speakers?
Next: Issue with PyUnicodeObject type variables
From: Stefan Behnel on 17 May 2010 05:35 superpollo, 17.05.2010 11:24: > Simon Brunning ha scritto: >> On 17 May 2010 09:34:51 UTC+1, shanti bhushan wrote: >>> i am new to python.i want to read the XML file using python it ,by >>> using DOm or SAX any of them. >>> I want to read the http://www.google.com(any hyper text) from XML and >>> print that. >>> please give me the sample program for this. >> >> Your question isn't very clear. Do you want to read the data from a >> URL (such as http://www.google.com) and parse it? If so, you probably >> don't want an XML parser as such - try Beautiful Soup. > > btw, is there any chance that bs will be part of the stdlib anytime soon? If someone takes over maintainership and offers support for the stdlib, this might be worth discussing. Otherwise, no. Stefan
From: Simon Brunning on 17 May 2010 05:49 On 17 May 2010 10:43:06 UTC+1, Shanti Bhushan <ershantibhushan(a)gmail.com> wrote: > Hi simon, > you are right in 2nd paragaraph. > i have a piece of XML with some URLs in it that i want to > extract. > I have no clue from where to get help on this. > Please atleast guide me for document or link where i can get such help > i can use elementary tree also but i dont know how to proceed with that. You've not given us any idea as to the structure of your XML, so this won't work. ;-) import xml.etree.ElementTree as ET for node in ET.parse('our.xml'): print node.text An introduction to ElementTree at <http://effbot.org/zone/element-index.htm>. -- Cheers, Simon B.
From: Alessandro Molari on 17 May 2010 20:13 I can suggest you the lxml library at http://codespeak.net/lxml/ I've already used it and I think it works very well, it's more pythonic than the built-in xml library For a simple use of xml functionalities you can read http://codespeak.net/lxml/tutorial.html -------- Alessandro Molari -------- On Monday 17 May 2010 10:34:51 shanti bhushan wrote: > Hi , > i am new to python.i want to read the XML file using python it ,by > using DOm or SAX any of them. > I want to read the http://www.google.com(any hyper text) from XML and > print that. > please give me the sample program for this. > regards > Shanti Bhushan > Bangalore,India
First
|
Prev
|
Pages: 1 2 Prev: tone generation for motherboard and sound card speakers? Next: Issue with PyUnicodeObject type variables |