return date of the post

This commit is contained in:
Mylloon 2021-08-24 10:19:33 +02:00
parent 80b8e11912
commit c2efc864d4

View file

@ -66,7 +66,12 @@ class Scraper:
_link = {"f": _link[0], "t": _link[1]} _link = {"f": _link[0], "t": _link[1]}
except: except:
_link = None _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"</a> <i class=\"icon-time\"></i> <small>(.*)</small>", 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 return elements