python - Switch to Frame by STYLE? -


i trying switch frame allows me type words.

html:

 <iframe style="height: 170px; width: 407px;">    #document     <html webdriver="true">        <head></head>       <body>            <br _editor_node="true"</br>    </body>   </html>   </iframe> 

the 1st code tried:

driver.switch_to_frame(driver.find_element_by_tag_name('iframe')) driver.find_element_by_css_selector('br[_moz_editor_bogus_node="true"]').send_keys('hi') 

2nd code tried:

for handle in driver.window_handles:         driver.switch_to.window(handle)  driver.switch_to_frame(driver.find_element_by_tag_name('iframe')) driver.find_element_by_css_selector('br[_moz_editor_bogus_node="true"]') 

my error:

nosuchelementexception: message: unable locate element: {"method":"css selector","selector":"br[_moz_editor_bogus_node=\"true\"]"} stacktrace:

is there way switch frame style?

this doesnt work

driver.switch_to_frame(driver.find_element_by_css_selector('iframe[style="height:.177px;.width.407px;"]')) 

the logical approach, given provided, iframe element having desired element inside it:

frame = driver.find_element_by_xpath('//iframe[br[@_moz_editor_bogus_node="true"]]') driver.switch_to.frame(frame) 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -