File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -9,15 +9,21 @@ class CodeforcesParser:
99 def get_solution (self , contest_id , submit_id ):
1010 """
1111 Returns source code for specified submit.
12+
13+ contest_id is the id of contest.
14+
15+ submit_id is the id of sumbission.
1216 """
1317 solutionPage = requests .get (
1418 "https://codeforces.com/contest/"
1519 + str (contest_id )
1620 + "/submission/"
1721 + str (submit_id )
1822 )
23+ if int (solutionPage .status_code ) != 200 :
24+ raise Exception ("Returned not OK code" + str (solutionPage ))
1925 tree2 = html .fromstring (solutionPage .text )
2026 code = tree2 .xpath ('//*[@id="pageContent"]/div[3]/pre/text()' )
2127 if len (code ) == 0 :
22- raise ValueError ("Incorrect contest_id or submit_id" )
28+ raise ValueError ("Incorrect contest_id or submit_id" + str ( code ) )
2329 return code [0 ].replace ("\r " , "" )
Original file line number Diff line number Diff line change 55
66setup (
77 name = "CodeforcesApiPy" ,
8- version = "1.3.2 " ,
8+ version = "1.3.3 " ,
99 description = "Implementation of codeforces.com API" ,
1010 platforms = "any" ,
1111 url = "https://github.com/VadVergasov/CodeforcesApiPy" ,
You can’t perform that action at this time.
0 commit comments