1

How can i access the multilevel html file using python selenium module. Sample html file is :

<!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>

I wanted to access the inner html file-id : "Email-input"

I tried following scenario to directly access the id="Email-input" and class="form-control stacked-input err" getting failed.

e.g. : >>> print driver.find_element_by_id("Email-input").is_displayed()

False

1 Answer 1

2

I solved it using switch_to.frame(id of the frame)

browser.switch_to.frame("ifrBmAuthApi")

Browser is the variable of the Webdriver

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.