// ce scripte a pour but de vous montrer comment aspirer les résultats des pages jaunes du Luxembourg

AUTORUN;
// ici la définitions des variables
var Adresse : string;
var description : string;
var email : string;
var Nom : string;
var SiteWeb : string;
var telephone : string;
var i,j:integer;
var s:string;
var ts: Tstringlist;ts:=Tstringlist.create;

createTable('description','email','Nom','SiteWeb','telephone');

//showDatabase;
//SetUniqueColumn('Nom');
for i:=10 downto 0 do begin;
    s:='A(0)/B(0)/TD(1)/TR(2)/TBODY(0)/TABLE(0)/TD(0)/TR('+inttostr(i)+')/TBODY(0)/TABLE(0)/TD(0)/TR(0)/TBODY(0)/TABLE(1)/BODY(0)/HTML(0)/';
    nom:=gettext(s,1);
    println(nom);
    s:='NOBR(0)/TD(0)/TR(2)/TBODY(0)/TABLE(0)/TD(0)/TR('+inttostr(i)+')/TBODY(0)/TABLE(0)/TD(0)/TR(0)/TBODY(0)/TABLE(1)/BODY(0)/HTML(0)/';
    telephone:=gettext(s,1);
    s:='TD(1)/TR(2)/TBODY(0)/TABLE(0)/TD(0)/TR('+inttostr(i)+')/TBODY(0)/TABLE(0)/TD(0)/TR(0)/TBODY(0)/TABLE(1)/BODY(0)/HTML(0)/';
    description:=gettext(s,1);
    s:='TD(4)/TR(1)/TBODY(0)/TABLE(0)/TD(0)/TR(0)/TBODY(0)/TABLE(0)/TD(0)/TR('+inttostr(i)+')/TBODY(0)/TABLE(0)/TD(0)/TR(0)/TBODY(0)/TABLE(1)/BODY(0)/HTML(0)/';
    s:= getHTML(s,1);
    ts.commatext:= extractUrlsfromString(s);
    println(s);
    s:='TD(2)/TR(0)/TBODY(0)/TABLE(0)/TD(0)/TR(0)/TBODY(0)/TABLE(0)/TD(0)/TR('+inttostr(i)+')/TBODY(0)/TABLE(0)/TD(0)/TR(0)/TBODY(0)/TABLE(1)/BODY(0)/HTML(0)/';
    //println(s);
    s:=getHTML(s,1);
    email:= extractEmails(s);

    InsertData(description,email,Nom,SiteWeb,telephone);



end;



// next

//IMG(0)/A(0)/TD(0)/TR(0)/TBODY(0)/TABLE(0)/TD(0)/TR(0)/TBODY(0)/TABLE(0)/TD(0)/TR(0)/TBODY(0)/TABLE(1)/BODY(0)/HTML(0)/