0

I'm having to find dates in a bunch of text, however some regular sentences get identified as dates such as "Unit 1: The Core Principles of Chemistry" as "datetime.datetime(2022, 10, 1, 0, 0)" for example which gives me a bunch of errors trying to find a date from this bunch of text.

This is the code I'm using(it's not exactly the same but the same thing essentially only difference is that I don't include how I get the string of text):

`

import datefinder

datelist=[]
matches=datefinder.find_dates("Unit 1: The Core Principles of Chemistry")
for x in matches:
    datelist.append(x)
print(datelist)

#Returns: datetime.datetime(2022, 10, 1, 0, 0)


`

imsolost
  • 11
  • 2

0 Answers0