def get_Auth():
USERNAME = User.get("1.0", END)
PASSWORD = Pass.get("1.0", END)
print(USERNAME)
print(PASSWORD)
url = 'https://ps.lphs.net/public/home.html'
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.92 Safari/537.36 Vivaldi/1.6.689.34'}
g = requests.get(url)
soup = BeautifulSoup(g.content)
'Find The Values'
PSTOKEN = None
CONTEXTDATA = None
for input in soup.find_all('input')[0:1]:
PSTOKEN = input.get('value')
print(PSTOKEN)
for input in soup.find_all('input')[1:2]:
CONTEXTDATA = input.get('value')
print(CONTEXTDATA)
payload = {
'pstoken': PSTOKEN,
'contextData': CONTEXTDATA,
'dbpw': '',
'translator_username': '',
'translator_password': '',
'translator_ldappassword': '',
'returnUrl': 'https://ps.lphs.net/guardian/home.html',
'serviceName': 'PS Parent Portal',
'serviceTicket': '',
'pcasServerUrl': '\ /',
'credentialType': 'User Id and Password Credential',
'account': USERNAME,
'pw': PASSWORD,
'translatorpw': ''
}
r = requests.post(soup, data=payload)
print(r)
I am trying to log on to PowerSchool and scrape my grades from a login required page. I have been watching video after video and cannot figure out why it won't work. I have a Tkinter window that asks for my username and password then uses that to log onto that website. But when I run it all I get is the login page source code. Here are the pictures of the Network tab under inspect element.
I'm not sure what's wrong here, I've been looking into this for a while now. Thanks in advance!