ychaouche wrote: > Hi, python experts. > > <console trace> > [EMAIL PROTECTED]:~/TEST$ python nettoyageHTML.py > [EMAIL PROTECTED]:~/TEST$ > </console trace> > > This is the nettoyageHTML.py python script > > <code> > from HTMLParser import HTMLParser > > class ParseurHTML(HTMLParser): > def __init__(self): > HTMLParser.__init__(self) > > def start_body(self,attrs): > print "this is my body" > > p = ParseurHTML() > p.feed(open("/home/chaouche/TEST/AJAX/testXMLRPC.html","r").read()) > </code> > > this is the testXMLRPC.html html file : > > <html> > <head> > <script type="text/javascript" language="javascript" > src="ClientXMLRPC.js"> > </script> > > <script type="text/javascript" language="javascript" > > > if (typeof netscape != 'undefined' && typeof netscape.security != > 'undefined') { > > netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserRea > d'); > } > > var chiffre = 0; > handler = function (self){ > if (self.xmlhttp.readyState == 4) { > reponse = self.xmlhttp.responseText; > //dump(reponse); permet d'acceder au dom si ce qu'on a recu est une > forme de xml. > document.getElementById("txt").innerHTML=reponse; > } > } > > function recupDonnees(){ > chiffre+=1; > client = new ClientXMLRPC(); > client.setUrl("http://10.75.49.100:8081/bonjour/sayHi? > chiffre="+chiffre); > client.executer(); > client.handlerEvenement = handler; > } > recupDonnees(); > > </script> > </head> > <body> > > <span id="txt">NON</span> > </body> > </html> > > > The script should output "this is my body", but nothing is printed. > Anyone ?
You need a p.close() after the feed I guess. Diez -- http://mail.python.org/mailman/listinfo/python-list