mirror of
https://github.com/house-of-vanity/fesmoo_perdoliq.git
synced 2025-07-07 22:04:08 +00:00
aa
This commit is contained in:
30
main.py
30
main.py
@ -1,9 +1,10 @@
|
|||||||
import requests
|
import requests
|
||||||
import settings
|
import settings
|
||||||
import logging
|
import logging
|
||||||
|
import re
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
|
|
||||||
logging.basicConfig(level=logging.DEBUG)
|
logging.basicConfig(level=logging.INFO)
|
||||||
|
|
||||||
|
|
||||||
class Main:
|
class Main:
|
||||||
@ -11,6 +12,7 @@ class Main:
|
|||||||
self.password = password
|
self.password = password
|
||||||
self.username = username
|
self.username = username
|
||||||
self.SessionId = ''
|
self.SessionId = ''
|
||||||
|
self.name = ''
|
||||||
|
|
||||||
def auth(self):
|
def auth(self):
|
||||||
r = requests.get(settings.fesmu_root_url)
|
r = requests.get(settings.fesmu_root_url)
|
||||||
@ -23,14 +25,24 @@ class Main:
|
|||||||
r = requests.post(
|
r = requests.post(
|
||||||
settings.fesmu_root_url,
|
settings.fesmu_root_url,
|
||||||
data=settings.merge(
|
data=settings.merge(
|
||||||
settings.scam_data,
|
settings.scam_data, {
|
||||||
{
|
'ctl00$MainContent$TextBox1': self.username,
|
||||||
'ctl00$MainContent$TextBox1': self.username,
|
'ctl00$MainContent$TextBox2': self.password,
|
||||||
'ctl00$MainContent$TextBox2': self.password,
|
}),
|
||||||
}
|
|
||||||
),
|
|
||||||
cookies={'ASP.NET_SessionId': self.SessionId})
|
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")
|
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