lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lynx-dev Re: Scripting LYNX to follow links


From: Sinan Kaan Yerli
Subject: lynx-dev Re: Scripting LYNX to follow links
Date: Tue, 7 Jul 1998 20:48:36 +0100

(07/07/1998 14:35) Ron Todd:

>Actually, I don't need keystroke recording, only replay or equivalent.
>Am I still out of luck?  I want to drive lynx from a shell script or C
>program that programatically generates the keystrokes for my lynx
>script, based on my program's analysis of each page that I print to
>a file.

Have you tried 'expect'?

Here is a _possible_ fragment that you can start with:
#!/usr/local/bin/expect -f

#some settings that you may have to do beforehand
...
spawn lynx http://bla.com
#assuming advanced mode
expect -re "(-more- )*(file|http|ftp):"; send "\t\t\t\r"
#continue until you reach your page by doing this expect/send couple
expect ....; send "...\r"
#and then turn the 'log_user' on and receive whole page (but with all
#the escape characters) -or- as you said use 'send "p\r"' to save the
#page using lynx process

something like this...

And there is more to this; you can have user input while within lynx
session. You can slow down the comm. line or increase, you can basicly
navigate _within_ the lynx session and
get/record/interpret/interact/save/log the sections of the outputed text
to the tty.

Anyway 'expect' is good piece of software when it is used properly.
Best advice is to start from the example directory of the package
(sorry, I dont't know the http address from top of my head).

I hope this helps.

-- 
Sinan Kaan Yerli <address@hidden>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]