// ce scripte a pour but de vous montrer comment extraire les résultats de cotations et les envoyer par email

var s:string;
var nom_action:string;
var rapport: Tstringlist;rapport:=Tstringlist.create;

navigate('http://fr.finance.yahoo.com/',1);
rapport.add('Cours de bourse à '+timetostr(time()));
rapport.add('');
nom_action:='alstom';
rapport.add('');
rapport.add('');

rapport.add(nom_action);
fillform('INPUT(1)/TD(1)/TR(0)/TBODY(0)/TABLE(0)/FORM(0)/TD(1)/TR(0)/TBODY(0)/TABLE(2)/CENTER(0)/BODY(0)/HTML(0)/',nom_action,1);
clickform('INPUT(0)/TD(1)/TR(0)/TBODY(0)/TABLE(0)/FORM(0)/TD(1)/TR(0)/TBODY(0)/TABLE(2)/CENTER(0)/BODY(0)/HTML(0)/',1);
s:=gettext('TABLE(0)/TD(0)/TR(0)/TBODY(0)/TABLE(0)/TD(4)/TR(0)/TBODY(0)/TABLE(0)/TD(0)/TR(0)/TBODY(0)/TABLE(1)/DIV(0)/DIV(1)/BODY(0)/HTML(0)/',1);
rapport.add(s);

navigate('http://fr.finance.yahoo.com/',1);
nom_action:='renault';
rapport.add('');
rapport.add('');
rapport.add(nom_action);
fillform('INPUT(1)/TD(1)/TR(0)/TBODY(0)/TABLE(0)/FORM(0)/TD(1)/TR(0)/TBODY(0)/TABLE(2)/CENTER(0)/BODY(0)/HTML(0)/',nom_action,1);
clickform('INPUT(0)/TD(1)/TR(0)/TBODY(0)/TABLE(0)/FORM(0)/TD(1)/TR(0)/TBODY(0)/TABLE(2)/CENTER(0)/BODY(0)/HTML(0)/',1);
s:=gettext('TABLE(0)/TD(0)/TR(0)/TBODY(0)/TABLE(0)/TD(4)/TR(0)/TBODY(0)/TABLE(0)/TD(0)/TR(0)/TBODY(0)/TABLE(1)/DIV(0)/DIV(1)/BODY(0)/HTML(0)/',1);
rapport.add(s);


sendstringbyemail('yarek','[email protected]',rapport.text);