From b28322a448adedcdde2b2487633c7d0d74f51a03 Mon Sep 17 00:00:00 2001 From: augustin64 Date: Tue, 13 Dec 2022 15:44:38 +0100 Subject: [PATCH] Update submit --- utils/cli.py | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/utils/cli.py b/utils/cli.py index 115a6cc..8de1258 100755 --- a/utils/cli.py +++ b/utils/cli.py @@ -51,20 +51,8 @@ def submit(year, day, answer, level=1): f"https://adventofcode.com/{year}/day/{int(day)}/answer", data={"answer": answer, "level": level}, ) - known_msgs = [ - "That's the right answer!", - "That's not the right answer", - "You gave an answer too recently", - "You don't seem to be solving the right level. Did you already complete it?", - ] - for msg in known_msgs: - if msg in request.text: - print(msg) - return - with open(f"answer-test-{year}-{int(day)}-{level}", "w", encoding='utf8') as file: - file.write(request.content.decode()) - - print("ok ?") + soup = BeautifulSoup(request.content, "html.parser") + print(soup.find("main").find("article").find("p").text) def __main__(options, args):