Skip to content

Commit

Permalink
Merge pull request #431 from kmyk/issue/430
Browse files Browse the repository at this point in the history
#430: follow the change of the HTML structure on Toph
  • Loading branch information
kmyk authored Jun 1, 2019
2 parents a76161f + 3bcbd8b commit 197920b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions onlinejudge/service/toph.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ def download_sample_cases(self, session: Optional[requests.Session] = None) -> L
resp = utils.request('GET', self.get_url(), session=session)
soup = bs4.BeautifulSoup(resp.content.decode(resp.encoding), utils.html_parser)
samples = onlinejudge._implementation.testcase_zipper.SampleZipper()
for case in soup.find('table', class_="samples").find('tbody').find_all('tr'):
log.debug('case: %s', str(case))
for table in soup.find_all('table', class_="samples"):
log.debug('table: %s', str(table))
case = table.find('tbody').find('tr')
assert len(list(case.children))
input_pre, output_pre = list(map(lambda td: td.find('pre'), list(case.children)))
assert input_pre.name == 'pre'
Expand Down

0 comments on commit 197920b

Please sign in to comment.