fix(scrapers): fix
This commit is contained in:
parent
18dbcd43d2
commit
b9a2c7a4ff
7 changed files with 84 additions and 28 deletions
|
|
@ -197,9 +197,9 @@ def _extract_samples(html: str) -> list[TestCase]:
|
|||
mi = re.search(r"Sample\s*Input\s*(\d+)", title, flags=re.I)
|
||||
mo = re.search(r"Sample\s*Output\s*(\d+)", title, flags=re.I)
|
||||
if mi:
|
||||
inputs[mi.group(1)] = t
|
||||
inputs[mi.group(1)] = t.strip()
|
||||
elif mo:
|
||||
outputs[mo.group(1)] = t
|
||||
outputs[mo.group(1)] = t.strip()
|
||||
cases: list[TestCase] = []
|
||||
for k in sorted(set(inputs) & set(outputs), key=lambda s: int(s)):
|
||||
cases.append(TestCase(input=inputs[k], expected=outputs[k]))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue