0

I'm trying to log in to a site using the requests module, and can't figure out how the site's login page actually works. Here's the relevant form:

<form class="ui-corner-all" method="POST" id="login" target="_top">
    <div id="lift__noticesContainer__"></div>
    <label for="username">Username</label><br>
    <input value="" id="username" type="text" name="F783713994214KVBZZQ">
    <label for="password">Password</label><br>
    <input value="" id="password" type="password" name="F7837139942151QISNM">
    <p><a data-at="e45a1d" href="/forgot_pwd">Forgot password?</a></p><br>
    <button class="btn btn-primary" type="submit" name="F783714094216F0PPFD" value="_">LOGIN</button>
</form>

I think the name of the fields are both randomly generated (F783713994214KVBZZQ and F7837139942151QISNM), so I parse those out, but I'm not sure what to do with that information. There's no login page url specified that I can see. I've tried constructing a payload of the above strings and correct login info and posting it with no result.

When I watch the network activity in chrome's inspector, after I click the login button I can see a post to the site but there's no query string parameters (where I would expect to see the username & password).

Does anyone know what else I should be looking at to figure out where the username and password are going and how to access that via requests?

Full login page html: https://pastebin.com/vP1s9esZ

My code: https://pastebin.com/4jG13WfW

The page includes a login.js in the header, but it's only this:

$(document).ready(function() {

$("#username").focus();

// Centers the div
$("#login").position({
    of: window,
    at: "center center"    
});

});

Thanks in advance for any help!

Don S
  • 3
  • 1

1 Answers1

1

You're looking for Selenium if you want to automate the login flow. But, if you want to make a request to the site, start with the network monitor. Click login and grab the request that goes to the site. They would either send it as a form or a payload.

Read more of the same at What's the difference between "Request Payload" vs "Form Data" as seen in Chrome dev tools Network tab

ayrusme
  • 506
  • 5
  • 17