How can I screen-scrape output from telnet in Perl?

后端 未结 6 358
死守一世寂寞
死守一世寂寞 2021-01-18 00:13

I can setup a telnet connection in Perl no problems, and have just discovered Curses, and am wondering if I can use the two together to scrape the output from the telnet ses

6条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-18 00:33

    Curses does the opposite. It is a C library for optimising screen updates from a program writing to a terminal, originally designed to be used over a slow serial connection. It has no ability to scrape a layout from a sequence of control characters.

    A better bet would be a terminal emulator that has an API with the ability to do this type of screen scraping. Off the top of my head I'm not sure if any Open-source terminal emulators do this, but there are certainly commercial ones available that can.

提交回复
热议问题