Hi, python experts.
<console trace>
chaouche@CAY:~/TEST$ python nettoyageHTML.p y
chaouche@CAY:~/TEST$
</console trace>
This is the nettoyageHTML.p y python script
<code>
from HTMLParser import HTMLParser
class ParseurHTML(HTM LParser):
def __init__(self):
HTMLParser.__in it__(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="javas cript"
src="ClientXMLR PC.js">
</script>
<script type="text/javascript" language="javas cript" >
if (typeof netscape != 'undefined' && typeof netscape.securi ty !=
'undefined') {
netscape.securi ty.PrivilegeMan ager.enablePriv ilege('Universa lBrowserRea
d');
}
var chiffre = 0;
handler = function (self){
if (self.xmlhttp.r eadyState == 4) {
reponse = self.xmlhttp.re sponseText;
//dump(reponse); permet d'acceder au dom si ce qu'on a recu est une
forme de xml.
document.getEle mentById("txt") .innerHTML=repo nse;
}
}
function recupDonnees(){
chiffre+=1;
client = new ClientXMLRPC();
client.setUrl(" http://10.75.49.100:80 81/bonjour/sayHi?
chiffre="+chiff re);
client.executer ();
client.handlerE venement = 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 ?
Y.Chaouche
<console trace>
chaouche@CAY:~/TEST$ python nettoyageHTML.p y
chaouche@CAY:~/TEST$
</console trace>
This is the nettoyageHTML.p y python script
<code>
from HTMLParser import HTMLParser
class ParseurHTML(HTM LParser):
def __init__(self):
HTMLParser.__in it__(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="javas cript"
src="ClientXMLR PC.js">
</script>
<script type="text/javascript" language="javas cript" >
if (typeof netscape != 'undefined' && typeof netscape.securi ty !=
'undefined') {
netscape.securi ty.PrivilegeMan ager.enablePriv ilege('Universa lBrowserRea
d');
}
var chiffre = 0;
handler = function (self){
if (self.xmlhttp.r eadyState == 4) {
reponse = self.xmlhttp.re sponseText;
//dump(reponse); permet d'acceder au dom si ce qu'on a recu est une
forme de xml.
document.getEle mentById("txt") .innerHTML=repo nse;
}
}
function recupDonnees(){
chiffre+=1;
client = new ClientXMLRPC();
client.setUrl(" http://10.75.49.100:80 81/bonjour/sayHi?
chiffre="+chiff re);
client.executer ();
client.handlerE venement = 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 ?
Y.Chaouche
Comment