input输入框里的值,用element.text获取不到,用一下方法获取

input=driver.find_element_by_xpath('XXXXXXXXXXXXX').

value=input.get_attribute('value')

 

也有人用js脚本然后用driver.excute_script(js)

js = "return $('input').val();"  #input用的是上面那个变量input
driver.execute_script(js)

或者

js = "return $('input').attr('value');"

driver.execute_script(js)

但是用js的方式我都没有成功

相关文章:

  • 2022-12-23
  • 2021-11-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-29
  • 2022-02-15
  • 2022-12-23
相关资源
相似解决方案