How to Use ANSI for Remote Screen Scraping?
goldspin at gmail.com
Sun Nov 2 02:03:24 CET 2008
Using the below script, I can use pexpect to correctly output the entire
remote terminal content to screen.
At this point, I am running into difficulty to scrap the screen, for the
screen elements that I want. (Say: the screen region from the complete 3rd
line to the 8th line.) I believe I need to use ANSI module. I tried a few
things, but have run out of ideas.
Can anyone please help? How can the code below be modified to use ANSI?
Thanks so much for any help.
child = pexpect.spawn ('ssh dummy_user at dummy_ip')
child.expect ('Password: ')
child.expect (' ')
child.sendline ('w2ktt') # windows 2000 terminal type
# This will output the console to the screen.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list