[NTLUG:Discuss] Automating Lynx
Dan Carlson
dcarlson at server.dcarlson.net
Tue May 14 09:37:13 CDT 2002
With relatively current versions of lynx (the last couple of years or so)
you can use the -cmd_log option to record a script and the -cmd_script
option to play it back.
lynx does want a terminal, so if you want to run it from a cron or at job
you will need to provide it with one. I got it to work by running it under
the 'screen' command.
I use a bash script invoked from cron with a command similar to this to
login to a web site and retrieve some data via https for subsequent
processing:
screen -m -D
/usr/bin/lynx -cfg=/etc/lynx.cfg -term=vt100 -accept_all_cookies -cmd_scrip
t myscript.cmd -nopause https://www.whatever.com
I am running lynx version 2.8.4dev.8 (24 Aug 2000).
Dan Carlson
----- Original Message -----
From: "Kenneth Loafman" <ken at lt.com>
To: <discuss at ntlug.org>
Sent: Tuesday, May 14, 2002 7:19 AM
Subject: Re: [NTLUG:Discuss] Automating Lynx
> Chris Cox wrote:
> >
> > Kenneth Loafman wrote:
> >
> > > It appears that one should be able to automate lynx with popen3(),
> > > however, lynx seems to want to go directly to the console rather than
> > > stdin. I seem to remember a mechanism to fool it, but its been a
long
> > > time sine then, so I'm asking anyone here... Is it possible to
script
> > > lynx?
> >
> > I guess there could be a reson to do this.... I would use Tcl expect.
> > http://expect.nist.gov/
> >
> > However... it all depends on what needs to be done... for many tasks,
> > wget may be sufficient.
> >
> > I'm curious... what exactly are you trying to do?
>
> Automate reporting of spam via SpamCop. Once I've determined its spam,
> SpamCop does not allow me to fire and forget. It still wants a
> multistep review process. For me, that's strictly a robotic exercise,
> so what's the best robot, a computer. Lynx looked like the simplest
> solution.
>
> ...Ken
>
> _______________________________________________
> http://www.ntlug.org/mailman/listinfo/discuss
>
More information about the Discuss
mailing list