I have the element
<p id="LIST_VAR2">3</p>
What I'd like to do is change the 3 to a 10. Is there anyway to do this with Selenium?
I have the element
<p id="LIST_VAR2">3</p>
What I'd like to do is change the 3 to a 10. Is there anyway to do this with Selenium?
I don't know of a pure Python way, but you can use Selenium to run some Javascript!
driver.execute_script('document.getElementById("LIST_VAR2").textContent="10";')
This Javascript finds the element using the ID with getElementbyId and changes the textContent.
Note that I use single quotes to surround the Javascript and double quotes inside the Javascript. This is so Python doesn't interpret the string as ending whenever it sees the double quote. As long as you use double quotes inside the JS and single quotes to surround it (or vice-versa), you'll be fine.