Skip to content

Commit

Permalink
only add if is date
Browse files Browse the repository at this point in the history
  • Loading branch information
Robso-creator committed Oct 21, 2024
1 parent 9972716 commit b6aa20b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/io/get_last_ref_date.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,14 @@ def main():
table = soup.find('table')
rows = table.find_all('tr')
list_last_modified_at = []
breakpoint()

print('creating dict files url')
for row in rows:
if row.find_all('td'):
if row.find_all('td')[1].find('a')['href']:
if row.find_all('td')[1].find('a')['href'].replace('-', '').replace('/', '').isdigit():
# get last modified time and parse to date (ex: '2021-07-19')
list_last_modified_at.append(row.find_all('td')[1].find('a')['href'].replace('/', ''))
# get the most common on 'last_modified' from source
list_last_modified_at.remove('CNPJ')
ref_date = max(list_last_modified_at)
print('last updated date is ', ref_date)

Expand Down

0 comments on commit b6aa20b

Please sign in to comment.