Screen scraping a 3270 terminal?

Aaron Vegh aaronvegh-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Mon Jan 14 15:12:55 UTC 2008


Thanks to everyone for their thoughts on this. It seems there are many
ways to skin this cat, which is great news. I think I'm liking the
suite of tools that are part of x3270 (I'm playing with c3270, which
is included, right now).

My biggest problem, it seems, is gaining access to the terminal in the
first place! The version that needs to be scraped is currently
accessed after logging into a web application, then engaging a
Java-based terminal on a https page. I can snag the server name from
the Java application, and with some plugging away with nmap, I
discovered what port it's running on. :-)

But here's the problem: when I log in using c3270, it's asking me for
a username and password. Fair enough, I'll use the one that gets me
into the web application. But the password is longer than the field!
It looks like this:

User id ===>          Password ===>          New Password ===>

By the time I finish typing the password, I look up and I'm in the
"New Password" field; the fields are only 8 characters long.

It seems there might be authentication server sitting between the web
app and the terminal, somehow passing on a modified login to the
terminal... is that possible? I don't have to log in when using the
Java-based terminal; I'm immediately given a command prompt there. Any
suggestions on how to overcome this block?

Thanks,
Aaron.

On Jan 14, 2008 9:22 AM, Kareem Shehata <kareem-d+8TeBu5bOew5LPnMra/2Q at public.gmane.org> wrote:
> > -----Original Message-----
> > From: owner-tlug-lxSQFCZeNF4 at public.gmane.org [mailto:owner-tlug-lxSQFCZeNF4 at public.gmane.org] On Behalf Of Lennart
> > Sorensen
> > Sent: Wednesday 09 January 2008 13:46
> > To: tlug-lxSQFCZeNF4 at public.gmane.org
> > Subject: Re: [TLUG]: Screen scraping a 3270 terminal?
> >
> > On Wed, Jan 09, 2008 at 12:50:44PM -0500, Aaron Vegh wrote:
> > > I have a client who wants me to scrape information from a number of
> > > web-located resources (they're all internal to their network). That's
> > > doable, but among the resources are two 3270 terminal sessions that
> > > have to be logged into, navigated through and then scraped.
> > >
> > > My normal procedure is to use curl to snatch and parse HTML from a
> > > site, and it will suffice for the rest of the job. But how does one
> > > programmatically parse through an old green screen application?
> >
> > expect works well for interactive text thingies.
>
> Could chat not be used for this as well?  It's a simplistic approach, but
> depending on the application, it might just do the trick.
>
> I've heard that expect is a powerful tool, but has a steep learning curve.
>
> Good luck!
>
> -kms
>
>
>
> --
> 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
>



-- 
Aaron Vegh, Principal
Innoveghtive Inc.
P: (647) 477-2690
C: (905) 924-1220
www.innoveghtive.com
www.website-in-a-day.com
--
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