Update cookies.

This commit is contained in:
USA Hexor
2018-06-04 08:15:44 +00:00
parent 7341eaaa4e
commit 52e78ef94d
3 changed files with 37 additions and 52 deletions

View File

@ -112,6 +112,7 @@ def do_action(update):
update.message.reply_text("Fetching tests...") update.message.reply_text("Fetching tests...")
sleep(5) sleep(5)
tests = list_test(s[1], s[2]) tests = list_test(s[1], s[2])
#print("******",tests)
else: else:
update.message.reply_markdown("Usage: */list <user[text]>"\ update.message.reply_markdown("Usage: */list <user[text]>"\
" <pass[text]>*") " <pass[text]>*")
@ -122,6 +123,7 @@ def do_action(update):
return False return False
msg = "Here is an available tests:\n``` " msg = "Here is an available tests:\n``` "
i = 0 i = 0
#print("******",tests)
for subj in tests: for subj in tests:
msg = msg + (" [%s] %s\n" % (i, subj)) msg = msg + (" [%s] %s\n" % (i, subj))
i += 1 i += 1

View File

@ -39,6 +39,7 @@ class Perdoliq:
settings.fesmu_root_url + 'startstu.aspx', settings.fesmu_root_url + 'startstu.aspx',
cookies={'ASP.NET_SessionId': self.SessionId}) cookies={'ASP.NET_SessionId': self.SessionId})
soup = BeautifulSoup(r.text, "html.parser") soup = BeautifulSoup(r.text, "html.parser")
#print("****** ", soup)
_p = re.compile(',.*$') _p = re.compile(',.*$')
self.name = _p.sub( self.name = _p.sub(
'', soup.find(id="ctl00_MainContent_Label1").get_text())[14:] '', soup.find(id="ctl00_MainContent_Label1").get_text())[14:]
@ -143,7 +144,7 @@ class Perdoliq:
"There isn't any correct answers for %s. Looks like"\ "There isn't any correct answers for %s. Looks like"\
" something went wrong. Trying other way...", q_number " something went wrong. Trying other way...", q_number
) )
# send all checkboxes as answer to 30th page # send all checkboxes as answer to 30th page (4 answers questions)
requests.post( requests.post(
settings.fesmu_root_url + 'studtst2.aspx', settings.fesmu_root_url + 'studtst2.aspx',
data=settings.merge( data=settings.merge(

File diff suppressed because one or more lines are too long