Hello again,

Thanks for your answer, but I am not used to LUA...
I already have a solution in perl but I would like to make it work with
links which seems to be faster ! Here is my issue :

When I do 
elinks -auto-submit 1 a.html
I will get : 
"La saisie du numéro est incorrecte" 
which is what I want (be patient, request is a little bit long).


--------------- a.html ----------------
                <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
                Transitional//EN">
                <html><head><title>Free</title>
                <meta http-equiv="Content-Type" content="text/html;
                charset=iso-8859-1">
                </head>
                <body onload="document.forms[0].submit()">
                <form action="http://infopresel.free.fr/identify.pl";
                method="post" name="jg">
                <INPUT TYPE="text" NAME="numero" VALUE="03893717">
                <input type="submit" value="Valider">
                </form></body></html>
--------------- a.html ----------------

BUT, When I add -dump
elinks -dump -auto-submit 1 a.html, I can't get the result...
So I tried to create /home/jg/.elinks/hooks.lua
http://links.sourceforge.net/links-lua/pwhooks.lua

--------------- /home/jg/.elinks/hooks.lua ----------------
                ---------------------------------------------
                --  pre_format_html_hook
                ---------------------------------------------
                
                function pre_format_html_hook (url, html)
                    local ret = nil
                
                open ELINKS, "|elinks -dump > $html.txt"
                print ELINKS "$html"
                close ELINKS
                
                    return ret and html
                end
--------------- /home/jg/.elinks/hooks.lua ----------------

What am I missing ?

Le lundi 06 mars 2006 à 22:29 +0100, [EMAIL PROTECTED] a écrit :
> On Wed, Mar 01, 2006 at 11:59:42AM +0100, jg wrote:
> > Hello,
> > 
> > I am using a.html which contains a form and a submit button. 
> > 
> > 1/
> >         If I do : "elinks -auto-submit 1 a.html" 
> > :-) ok I get the good result
> > 
> > 2/
> > If I add "-dump" : 
> > elinks -dump -auto-submit 1 a.html > toto, 
> > :-(
> > elinks will not go on the page I want (toto=a.html) 
> > 
> > How can I get the result into toto.txt ?
> > Any help please ?
> 
> You could use browser scripting, eg. Perl
> Put somewhere in pre_format_html_hook something like this:
> open ELINKS, "|elinks -dump > $html.txt";
> print ELINKS "$html";
> close ELINKS;
> #exit;
> 
> Run elinks -auto-submit 1 url and ELinks will dump page for you.
> This is good enough for similar cases like javascript redirects,
> dumping frames, etc.
> 
> HTH,
> Witek
> 
> _______________________________________________
> elinks-users mailing list
> [email protected]
> http://linuxfromscratch.org/mailman/listinfo/elinks-users
> 

_______________________________________________
elinks-users mailing list
[email protected]
http://linuxfromscratch.org/mailman/listinfo/elinks-users

Reply via email to