I try to enter my school site using Requests, but it does not go past the login page and does not return data on password-protected pages. All he does is return the HTML login page. Twill will not work, since javascript is required on this page., Material for entering HTML:
<div id="noscript" class="feedback-alert"> To sign in to PowerSchool, you must use a browser that supports and has JavaScript enabled. </div> <fieldset id="login-inputs" class="hide"> <div> <label>Username</label> <input type="text" id="fieldAccount" name="account" value="" size="39" /> </div> <div> <label>Password</label> <input type="password" name="pw" value="" size="39" /><div id="login-help"><a href="/public/account_recovery_begin.html">Having trouble signing in?</a></div> </div> <div id="translatorInput"> <label>Translator Sign In</label> <input type="password" name="translatorpw" value="" size="39" /> </div> <div class="button-row"> <button type="submit" id="btn-enter" title="Sign In To PowerSchool Parent Access" value="Enter" border="0" >Sign In</button> </div> </fieldset>
I checked this answer
My current code
import requests payload = { 'account': 'username', 'pw': 'password' } with requests.Session() as s: p = s.post('https://powerschool.-/public/home.html', data=payload) print p.text r = s.get('https://powerschool.-/guardian/studentsched.html') print r.text
but I canβt access the page. My question is: do I suppose I have a payload to click the send button or something else? I tried 'action' : 'login' and all that, but none of this works. Also, I don't need translatorpw , so should I write 'translatorpw': '' or just ignore it? Obviously, I put my real username / password in the program on my laptop. Thanks in advance!
Edit: I just used Selenium and it worked very easily.
source share