I need to change the style, background-color attribute from (213, 171, 128):
<div class="rAgBzQ" style="background-color: rgb(213, 171, 128);">
</div>
to (0, 0,0)
<div class="rAgBzQ" style="background-color: rgb(0, 0, 0);">
</div>
Tried using the following code, with the error below. Not sure what I'm doing wrong?
div_to_change = driver.find_element_by_xpath("""myxpath""")
driver.execute_script("arguments[0].style.background-color = 'rgb(0, 0, 0)';", div_to_change)
ERROR:
selenium.common.exceptions.JavascriptException: Message: javascript error: Invalid left-hand side in assignment