From c2efc864d4d161f38ea1155aa3d5adddede51f48 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Tue, 24 Aug 2021 10:19:33 +0200 Subject: [PATCH] return date of the post --- main.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 07f332a..22c3382 100644 --- a/main.py +++ b/main.py @@ -66,7 +66,12 @@ class Scraper: _link = {"f": _link[0], "t": _link[1]} except: _link = None - elements[i] = {"title": _title, "author": _author, "link": f"https://forum.mobilism.org/viewtopic.php?f={_link['f']}&t={_link['t']}", "linkParams": _link} + try: + _date = findall(r" (.*)", elements[i])[0] + except: + _date = None + print("\n" + elements[i] + "\n") + elements[i] = {"title": _title, "author": _author, "date": _date, "link": f"https://forum.mobilism.org/viewtopic.php?f={_link['f']}&t={_link['t']}", "linkParams": _link} return elements