python - Browser does not support frames Exception -


i using python + selenium interact webpage frameset , frames.

however, error when sth print driver.page_source:

<frameset cols="*" border="0" framespacing="0" rows="118,*" frameborder="0" onbeforeunload="unload()">     <frame src="/xxx/frameset/xxx.html" name="entete_win" id="entete_win" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" />     <frame src="/xxx/frameset/bodyframe.html" name="body_win" id="body_win" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" />     <noframes>         &lt;body bgcolor="#ffffff"&gt;         browser not support frames.         &lt;/body&gt;   </noframes> </frameset> 

my selenium version 2.53.2. tried firefox , chrome driver 2.21.

if understand question correctly, not getting error. driver.page_source shows actual html of page. in case, page contains 2 frames, additional section called <noframes>, end-user see if browser did not support frames. see not error targeted @ you.

i suggest automation, ignore entire <noframes> section together. very old browsers (e.g. ie 2) not support frames (see detailed explanation on frames here).

now if understand correctly, trouble cannot select elements, because elements in frames. well, selenium provides whole set of functions deal frames. see this selenium on python.

so before selecting other elements, need select , switch corresponding frame. example:

driver.switch_to_default_content() driver.switch_to_frame("entete_win") 

will switch left frame (the first statement makes sure on "main" window begin with). or

driver.switch_to_default_content() driver.switch_to_frame("body_win") 

to switch right frame.

all other html elements inside frames, can select them using normal xpath, css , other selectors.


Comments

Popular posts from this blog

PySide and Qt Properties: Connecting signals from Python to QML -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

scala - 'wrong top statement declaration' when using slick in IntelliJ -