dfreelon / news_extract

Python module to extract articles from NexisUni and Factiva.
BSD 3-Clause "New" or "Revised" License
36 stars 9 forks source link

List out of bounds in nexis_rtf_extract #3

Open ghost opened 4 years ago

ghost commented 4 years ago

Hi,

I am kind of a rookie in programming, but I found an error in the code and fixed it. I probably didn't fix it very good, and I should probably not post this here, but maybe it helps some people.

Sometimes the date is not in nex_split[2] but in nex_split[3], which gives a list out of bounds error. So i wrote this:

if re_date_nu.findall(nex_split[2]) == []: date_str = re_date_nu.findall(nex_split[3])[0] else: date_str = re_date_nu.findall(nex_split[2])[0]

dfreelon commented 3 years ago

Thanks!