How do I use python variable in a javascript?

后端 未结 4 1142
再見小時候
再見小時候 2020-12-30 13:28

I\'ve been on a prowl looking for a way to access a non visible text field using selenium\'s webdriver. The only way i got it to work is using

driver.execut         


        
4条回答
  •  别那么骄傲
    2020-12-30 13:52

    Unless I'm misisng something, one option is:

    driver.execute_script("document.getElementById('text_field').value+='{0}'".format(foo)) 
    

提交回复
热议问题