dimanche 30 juillet 2017

Python replace javascript double quotes in javascript code

I am trying to get selenium webdriver to execute the following javascript

document.querySelector('#location > input[type="text"]').value="10001"

but when I use the

execute_script("document.querySelector('#location > input[type="text"]').value="10001"")

Because of the quotes, it fails to run, how to escape the quotes?




Aucun commentaire:

Enregistrer un commentaire