# selecting the vm canvas
`ft=driver.find_element_by_id("noVNC_screen").find_element_by_id("noVNC_canvas")'
time.sleep(20)
ft.send_keys("root") #sending user name
ft.send_keys(webdriver.common.keys.Keys.ENTER)
time.sleep(5)
ft.send_keys("secret") # sending password
ft.send_keys(webdriver.common.keys.Keys.ENTER)
time.sleep(10)
ft.send_keys("ifconfig") # sending ifconfig command to canvas
time.sleep(3)
ft.send_keys(webdriver.common.keys.Keys.ENTER)
time.sleep(3)
driver.close()
发送ifconfig命令后,它在画布上显示输出。但我必须通过脚本检查ip是否即将到来,因为我想将ifconfig输出到文件或变量.....
请给我一个解决方案来做到这一点...... 谢谢..