i'm trying to get a textarea in python with selenium. When i go to the browser, i open the console and i send this :
document.querySelector('[id^="h-captcha-response-"]')
I get my textarea, it's perfect.
textarea id="h-captcha-response-0l5458ke7qc" name="h-captcha-response" style="display: none;">
And when i do this command in python with selenium and i want to fill the .innerHTML like :
driver.execute_script(f'''
document.querySelector('[id^="h-captcha-response-"]').innerHTML = "{code}"
''')
It's say :
selenium.JavascriptException: javascript error: Cannot set properties of null (setting 'innerHTML')
Why do I get this error ? On my browser's console I can select the textarea without any problem so why my textarea is null now ?
Thank you for your answer
Joss