Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
:return: a string representing the date.
:rtype: str
"""
date_pattern = re.compile(
r'''
>Date: # The name of the desired field.
\s* # # Any whitespace
(?:)? # Non capture closing span tag
(?:)? # Non-capture (literal match).
([^<]*) # Capture any character except '<'.
< # Non-capture (literal match)
''',
re.VERBOSE,
)
date = match_pattern(page, date_pattern).replace('.', ' ')
date = search_dates(date)
return date[0][1].date() if date else None