使用请求登录seedr.cc

时间:2019-03-13 10:21:46

标签: python python-3.x python-requests

我正在尝试登录网站seedr.cc,我获得了电子邮件和密码的名称,但我不知道Submit按钮的值,因此我将Submit作为值并在发布后加上了{ )我正在检查它是否已登录,但是没有登录,并且碰巧没有错误,所以我不知道为什么它没有登录。

import requests

r = requests.session()
res = r.get('http://seedr.cc',headers={'User-Agent':'Chrome/5.0'})
data = {
                'username':username,
                'password':password,
                'sign-in-submit':'Submit',
                }
headers = {'User-Agent':'Chrome/5.0',
                     }
res = r.post('http://seedr.cc',
                            data=data,
                            headers=headers,
                            cookies=r.cookies
                            )
res=r.get('https://www.seedr.cc/settings',headers=headers,cookies=r.cookies)

预先感谢

编辑:

这是表格:

<form class="sign-in-form" disabled="disabled">

    <div class="modal-body">
        <div class="row">
            <div class="large-12 columns">
                <label> <span>Email</span>
                    <input placeholder="email" name="username" type="text" tabindex="1" required="">
                </label>
            </div>
        </div>
        <div class="row">
            <div class="large-12 columns">
                <label> <a id="forgot-password-link">Forgot your password?</a> <span>Password</span>
                    <input placeholder="password" name="password" pattern=".{6,}" type="password" tabindex="2" title="It must contain the password that you have chosen at registration" required="">
                </label>
            </div>
        </div>
        <div class="row">
            <div class="large-12 columns">
                <label style="text-align:center"> <input type="checkbox" name="rememberme" tabindex="3"> <small> Keep me logged in ( <b>this is a private computer</b> )</small> </label>
            </div>
        </div>
        <div class="row">
            <!--<div class="large-12 columns" id="login-recaptcha-container" style="text-align:center">
                <div id="login-recaptcha" style="max-width: 307px;display: inline-block;"></div><br>
            </div>-->
        </div>
        <div class="large-12 columns" id="premium-bot" style="margin-bottom: 10px;">
            <small>* Premium users may skip verification -- <span data-tooltip="" aria-haspopup="true" class="has-tip" data-disable-hover="false" data-selector="tooltip-jt6znnt77" aria-describedby="tooltip-jt6znnt77" title="">why?</span></small>
        </div>
    </div>
    <a class="close-reveal-modal">×</a>
    <div class="modal-footer" style="margin: 0 13px 0 13px;border-top: none;">
        <button style="margin-bottom:0;background: rgb(80, 139, 208);WIDTH: 100%;border-radius: 5px;" name="sign-in-submit" type="submit" class="button radius" tabindex="5"><i class="fa fa-check"></i> Login</button>
        <div id="login-separator">
            - OR - </div>
        <button type="button" onclick="javascript:FBlogin(false,$(this).closest('form').find('input[name=rememberme]').prop('checked'));return false;" style="margin-bottom:0;background: #354E84;WIDTH: 100%;border-radius: 5px;line-height: 100%;" name="sign-in-submit" class="button radius"><img src="https://static.seedr.cc/images/facebook_icon.png" style="
            line-height: 35px;
            margin-right: 8px;
            vertical-align: -5px;
            "> Login with Facebook </button>
        <small class="facebook-email-required" style="
            text-align: left;
            width: 100%;
            color: red;
            padding: 10px;
            display:none;
            ">Email access is required for login , please try again</small>
    </div>
</form>

0 个答案:

没有答案