如何通过pexpect发送光标移动,如上,下,左,右键。下面的示例是自动化链接,该链接使用向上/向下键在页面上选择不同的链接。
from pexpect import spawn child = spawn('elinks http://python.org') #what goes here to send down key child.interact()
python pexpect
pexpect ×1
python ×1