首页 > 解决方案 > 如何使用 BeautifulSoup 填写登录表单

问题描述

我想使用 BeautifulSoup 填写登录表单(我知道这不是最简单的方法),但我不知道该怎么做。这里在loginForm 下。

    <form id="loginForm" class="loginContainer" accept-charset="utf-8" action="/wipb2bweb/j_spring_security_check;jsessionid=C647FBABEB8C4ADC3DCCA3C6C875BECC.prod1" method="post"><fieldset>
            <legend>Login</legend>

            <img src="/wipb2bweb/_ui/themes/carhartt/images/loginTitle.png"
                alt="Login" class="title" />

            <form>
                <div class="formRow">
                    <label for="User"><img
                        src="/wipb2bweb/_ui/themes/carhartt/images/loginLabelUser_de.png"
                        alt="Benutzername" />
                    </label>
                    <input id="User" name="j_username" type="text" value=""/></div>
                <div class="formRow">
                    <label for="Password"><img
                        src="/wipb2bweb/_ui/themes/carhartt/images/loginLabelPass_de.png"
                        alt="Passwort" />
                    </label>
                    <input id="Password" name="j_password" type="password" value=""/></div>
                <input type="submit" class="hiddenSubmit"/>
                <a href="#" title="Login" class="btnGreyTextured">
                    <span>Login</span>
                </a>
            </form>

标签: pythonbeautifulsoup

解决方案


推荐阅读