log in to a website using Python's Requests module doesn't work on this site but work on other site -
use following code on twitter , github work fine doesn't work on main site using for, can please tell me went wrong. did not error instead scrap login page instead of log me.
import requests session = requests.session() params = {'j_username': '**********', 'j_password': '************'} r = requests.post("https://connect.data.com/loginprocess", params) print("cookie set to:") print(r.cookies.get_dict()) print("-----------") print("going profile page...") r = requests.get("https://connect.data.com/home") print(r.text)
i new can't figure out went wrong, have try many answer out before asking question none seem workout site. login url /login file login been process /loginprocess why use /loginprocess loginprocess not print out cookie /login print out form site this:
<form id="command" name="loginform" action="https://connect.data.com/loginprocess" method="post"> <div> <div class="login-container fields float-left"> <div class="content"> <div class="first"> <span class="title">login</span> </div> <div class="middle"> <input id="j_username" name="j_username" type="email" class="text" placeholder="email" maxlength="128" tabindex="1"> </div> <div class="middle"> <input id="j_password" name="j_password" type="password" class="text" placeholder="password" autocomplete="off" tabindex="2" maxlength="128"> </div> <div class="middle"> <label for="_spring_security_remember_me" class="general-checkbox-label"> <input name="_spring_security_remember_me" tabindex="3" value="on" id="_spring_security_remember_me" class="checkbox margin-0px" type="checkbox"> <span>keep me logged in </span> </label> </div> <div class="last"> <button id="login_btn" type="submit" class="button-standard button-primary" tabindex="4"> <span class="button-standard-text">login</span> </button> <a class="link" href="https://connect.data.com/forgotpassword" onclick="var x=".tl(";s_objectid="https://connect.data.com/forgotpassword_1";return this.s_oc?this.s_oc(e):true">forgot password?</a> </div> </div> </div> <div class="login-container marketing-message float-right"> <div class="content"> <h2> don't have account? sign - it's free! </h2> <div class="float-left"> <img class="login-bicons" src="./data.com connect business contact directory of business contacts , company information_files/clear.cache.gif"> </div> <div class="float-left margin-left-20px"> <p> <span id="pagetitle" style="color: #146791">find</span> business card information & b2b professionals. </p> <p> <span id="pagetitle" style="color: #87c540">research</span> people & companies. </p> <p class="margin-top-5px"> <span id="pagetitle" style="color: #f37521">get</span> millions of contacts. </p> </div> <div class="clear"></div> </div> </div> <div class="clear nonlogged-container-foot"> <span class="new-to-ddc">new data.com?</span> <a class="sign-up" href="https://connect.data.com/registration/signup" onclick="var x=".tl(";s_objectid="https://connect.data.com/registration/signup_1";return this.s_oc?this.s_oc(e):true">sign account...</a> </div> </div> <input type="hidden" name="csrf_token" id="csrf_token" value="ce56932e08fc97bc29c5f6535b572664a66000513143584504b0ee7c66ef9659"></form>
Comments
Post a Comment