This is my Code (without imports and stuff):
driver.get('http://democaptcha.com/demo-form-eng/hcaptcha.html')
time.sleep(3)
driver.execute_script("document.getElementsByName('h-captcha-response').style.display='none';")
But this throws me the error:
selenium.common.exceptions.JavascriptException: Message: javascript error: Cannot set property 'display' of undefined
when i do:
driver.execute_script("document.getElementById('h-captcha-response-0zu3aawejggj').style.display = 'block';")
it shows me the error
selenium.common.exceptions.JavascriptException: Message: javascript error: Cannot read property 'style' of null
(code is referenced to)
Selenium (with python) how to modify an element css style
How can I change/remove style attibute with selenium python?
THANKS!
getElementsByNamereturns an array of elements, not one element. You can't dogetElementsByName().style. An array has no.styleproperty.