How can you send cursor movements like the up,down,left,right keys with pexpect. The example below is to automate elinks which uses the up/down keys to select different links on a page.
from pexpect import spawn
child = spawn('elinks http://python.org')
#what goes here to send down key
child.interact()
How about using escape sequence for up(^[[A) or down(^[[B) like this.