2016-10-28 4 views
1

Wie kann ich auf die mehrstufige HTML-Datei mit Python Selen-Modul zugreifen. Beispiel-HTML-Datei ist: "E-Mail-Eingang"Python Selen Zugriff auf mehrstufige HTML

Ich habe versucht folgende Szenario, um direkt Zugriff auf die id = "E-Mail-Eingang:

<!DOCTYPE html> 
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#"> 
    <head> 
     <body style="background: rgb(26, 26, 26)" class="remodal_lock remodal_active"> 
     <iframe id="ifrBmAuthApi" class="black-bg"> 
      <!DOCTYPE html> 
      <html> 
       <head> 
       </head> 
       <body> 
       <div class="ascendon"> 
        <div id="accountManagementDiv" class="container-fluid"> 
         <form id="SAMLPOST" method="POST"> 
          <div class="validation-summary" cdvalidate="Email"></div> 
          <input id="Email-input" class="form-control stacked-input err" data-prop="Email" maxlength="50" required="" placeholder="Email" type="email"> 
          </div> 
         </form> 
        </div> 
       </div> 
      </body> 
     </html> 
    </iframe> 
    </body> 
</head> 

ich die innere html-Datei-ID zugreifen wollte "und Klasse =" Form-Control-Stacked-Input-Fehler "fehlgeschlagen.

z.B. . >>> print driver.find_element_by_id ("E-Mail-Eingang") is_displayed()

Falsch

Antwort

2

Ich löste es switch_to.frame (id des Rahmens)

browser.switch_to.frame("ifrBmAuthApi") 

Browser ist mit die Variable des Webtreibers