Screen scraping a 3270 terminal?

Paul King sciguy-Ja3L+HSX0kI at public.gmane.org
Mon Jan 14 11:02:42 UTC 2008


On Mon, 2008-01-14 at 03:55 -0500, David C. Chipman wrote:
> 	Hi Aaron, 
> 
> 		Have you looked into using 'expect(1)'? That might do
> what you want. Also, did you consider trying to use ssh, and sending
> it's output to a file? I don't know if these will solve your problem,
> and if not I'm sorry. BTW, why dose the terminal being a 3270 matter?
> Later, 
> 

No, I don't think that the terminal itself matters except that the
technology implied inside the computer would matter. (no HTML likely, so
no curl solution).

Actually, expect sounds good, but a lot of work. Another quick and dirty
character-based solution would be to use a terminal command called
script(1). script captures every keystroke you did (including the
backspace key and all escape characters) and every bit of output that
went to your terminal. It saves it in a file. Run a command, and script
captures everything. That requires no scripting, just run the command,
script runs a subshell, and you treat it like a normal shell (which it
actually is). "logout" (or CTRL+D) logs you out of the subshell, closes
the file, which you can now edit as a text file (recommended, since all
non-ASCII characters need to be edited out of the file -- I find vi to
be especially useful for this kind of editing).

Read the manpage.

Paul King

> 			-David Chipman
> --
> The Toronto Linux Users Group.      Meetings: http://gtalug.org/
> TLUG requests: Linux topics, No HTML, wrap text below 80 columns
> How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists
>
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list