mirror of
https://github.com/house-of-vanity/fesmoo_perdoliq.git
synced 2025-07-07 14:04:06 +00:00
aa
This commit is contained in:
30
main.py
30
main.py
@ -1,9 +1,10 @@
|
||||
import requests
|
||||
import settings
|
||||
import logging
|
||||
import re
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
|
||||
|
||||
class Main:
|
||||
@ -11,6 +12,7 @@ class Main:
|
||||
self.password = password
|
||||
self.username = username
|
||||
self.SessionId = ''
|
||||
self.name = ''
|
||||
|
||||
def auth(self):
|
||||
r = requests.get(settings.fesmu_root_url)
|
||||
@ -23,14 +25,24 @@ class Main:
|
||||
r = requests.post(
|
||||
settings.fesmu_root_url,
|
||||
data=settings.merge(
|
||||
settings.scam_data,
|
||||
{
|
||||
'ctl00$MainContent$TextBox1': self.username,
|
||||
'ctl00$MainContent$TextBox2': self.password,
|
||||
}
|
||||
),
|
||||
settings.scam_data, {
|
||||
'ctl00$MainContent$TextBox1': self.username,
|
||||
'ctl00$MainContent$TextBox2': self.password,
|
||||
}),
|
||||
cookies={'ASP.NET_SessionId': self.SessionId})
|
||||
|
||||
r = requests.get(settings.fesmu_root_url + 'startstu.aspx', cookies={'ASP.NET_SessionId': self.SessionId})
|
||||
r = requests.get(
|
||||
settings.fesmu_root_url + 'startstu.aspx',
|
||||
cookies={'ASP.NET_SessionId': self.SessionId})
|
||||
soup = BeautifulSoup(r.text, "html.parser")
|
||||
print(soup.find(id="ctl00_MainContent_Label1"))
|
||||
_p = re.compile(',.*$')
|
||||
self.name = _p.sub(
|
||||
'', soup.find(id="ctl00_MainContent_Label1").get_text())[14:]
|
||||
logging.info('Current user is %s', self.name)
|
||||
|
||||
def get_tests(self):
|
||||
r = requests.get(
|
||||
settings.fesmu_root_url + 'studtst1.aspx',
|
||||
cookies={'ASP.NET_SessionId': self.SessionId})
|
||||
for tag in soup.find_all(re.compile("ctl00_MainContent_ASPxCallbackPanel1_ASPxListBox2_LBI\dT0")):
|
||||
print(tag.name)
|
||||
|
Reference in New Issue
Block a user