I've been trying to use the request library in order to send information to a web server. However, I have no clue what data to send to the server in order to log in. (This is my first time using requests and I was wondering if someone could help explain this to me) Edit: I'm trying to make it submit a username and password to the site.
My code:
import requests
Sdata = {'username':'testingemail@gmail.com','password':'testing123','login':'submit'}
r = requests.post(url = 'https://gmchosting.com/billing/clientarea.php',data=Sdata)
html = r.text
print(html)
The Part of the website I want the file to communicate with:
<input type="hidden" name="token" value="003cc13dfa662dd183f098c2a2afc81331da0ba3" />
<div class="form-group">
<label for="inputEmail">Email Address</label>
<input type="email" name="username" class="form-control" id="inputEmail" placeholder="Enter email" autofocus>
</div>
<div class="form-group">
<label for="inputPassword">Password</label>
<input type="password" name="password" class="form-control" id="inputPassword" placeholder="Password">
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="rememberme" /> Remember Me
</label>
</div>
<div align="center">
<input id="login" type="submit" class="btn btn-primary" value="Login" /> <a href="pwreset.php" class="btn btn-default">Forgot Password?</a>
</div>
</form>
</div>