Background
Part of my work in networking and telco involves automating telnet sessions when legacy hardware doesn't offer easy solutions in other interfaces. Many older pieces of equipment can only be accessed via craft ports (RS-232 serial ports), SNMP, or telnet. Sometimes telnet is the only way to access specific information, however telnet is designed as a human interface and thus requires screen scraping. In addition, there is also the issue of scraping screens where only portions are updated in order to save bandwidth (see ncurses). In my work I have used ActiveState Expect and the Python telnet library.
Question
Which languages and libraries are able to automate telnet sessions and have the following requirements:
A preferable solution would also include the following:
Take a look at demos/Expect/term_expect in the ActiveTcl distribution. It emulates a cursor-addressable terminal and allows you to test output at specific screen locations. Check out the example screen-scraping code at the end of the file.