fix(scraper/codeforces): scrape multiple tc
This commit is contained in:
parent
66b7db6da4
commit
91e066bbd6
4 changed files with 20 additions and 19 deletions
|
|
@ -200,8 +200,7 @@ def main() -> None:
|
|||
|
||||
test_list: list[dict[str, str]] = []
|
||||
for input_data, output_data in tests:
|
||||
normalized_input = "1\n" + input_data
|
||||
test_list.append({"input": normalized_input, "expected": output_data})
|
||||
test_list.append({"input": input_data, "expected": output_data})
|
||||
|
||||
result = {
|
||||
"success": True,
|
||||
|
|
|
|||
|
|
@ -32,11 +32,12 @@ def scrape(url: str) -> list[tuple[str, str]]:
|
|||
continue
|
||||
|
||||
for div in test_line_divs:
|
||||
classes = div.get("class", [])
|
||||
class_name = next(
|
||||
(
|
||||
cls
|
||||
for cls in div.get("class", [])
|
||||
if "test-example-line-" in cls
|
||||
for cls in classes
|
||||
if "test-example-line-" in cls and cls.split("-")[-1].isdigit()
|
||||
),
|
||||
None,
|
||||
)
|
||||
|
|
@ -60,11 +61,12 @@ def scrape(url: str) -> list[tuple[str, str]]:
|
|||
continue
|
||||
|
||||
for div in test_line_divs:
|
||||
classes = div.get("class", [])
|
||||
class_name = next(
|
||||
(
|
||||
cls
|
||||
for cls in div.get("class", [])
|
||||
if "test-example-line-" in cls
|
||||
for cls in classes
|
||||
if "test-example-line-" in cls and cls.split("-")[-1].isdigit()
|
||||
),
|
||||
None,
|
||||
)
|
||||
|
|
@ -88,7 +90,6 @@ def scrape(url: str) -> list[tuple[str, str]]:
|
|||
prefixed_input = "1\n" + input_text
|
||||
tests.append((prefixed_input, output_text))
|
||||
return tests
|
||||
|
||||
all_inputs = []
|
||||
all_outputs = []
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue