How to change innerHTML with python in a selenium firefox window? -


i trying enter string of characters hidden text area on page opened selenium firefox. have gotten return html, have not been able figure out how edit html, able when inspecting element. new coding, please excuse how ignorant may sound.

this html trying type into:

<textarea id = "xxx"           name = "xxx"           class = "xxx"           style = "border  : 1px solid #c1c1c1;                    display : none;                    height  : 40px;                    margin  : 10px 25px;                    padding : 0px;                    resize  : none;                    width   : 250px;"> </textarea> 

i understand want enter needs input between 2 > <, not know how 1. input text there using python, , 2. if text input there there if textarea still set display : none.

if want make text area visible, need make 'display:none' 'display:block' using execute script below. after can send text using sendkeys.

driver = webdriver.firefox() driver.implicitly_wait(20) driver.get("url of page") driver.maximize_window() driver.execute_script("document.getelementbyid('xxx').style.display = 'block';") driver.find_element_by_id("xxx").send_keys("test") 

let me know if have queries


Comments

Popular posts from this blog

c# - Update a combobox from a presenter (MVP) -

How to understand 2 main() functions after using uftrace to profile the C++ program? -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -