caesar318 caesar318 - 11 months ago 108
Python Question

python- using splinter to open and login webpage failed, help!!

I want to auto login this website,but it's doesn't work not matter browser.fill or


below was the information of input:

<input type="email" class="si-text-field" id="appleId" can-field="accountName" autocomplete="off" autocorrect="off" autocapitalize="off" aria-required="true" required="required" aria-labelledby="appleIdFieldLabel" spellcheck="false" autofocus="" placeholder="Apple ID">
<input type="password" id="pwd" aria-required="true" required="required" can-field="password" autocomplete="off" class="si-password si-text-field " placeholder="Password">

but when I use code below,it doesn't work, I don't know any special of the login form,


splinter.exceptions.ElementDoesNotExist: no elements could be found with name "appleId"

Answer Source

The form is inside an iframe, switch to it before filling the login and password:

with browser.get_iframe('aid-auth-widget-iFrame') as iframe:
    browser.find_by_id("appleId").type("your login") 
    browser.find_by_id("pwd").type("your password")