Skip to content

Commit

Permalink
notification news
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelKatsoulis committed Apr 29, 2018
1 parent ced7b3e commit af18770
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions scrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,15 @@ def main():

h_link_soup = BeautifulSoup(h_link_content, "html.parser")
url_image = h_link_soup.find("meta", property="og:image")
time = [meta.get('content') for meta in h_link_soup.find_all('meta', itemprop='datePublished')]
if time:
date = time[0][:time[0].find("T")]
else:
today = datetime.date.today()
date = '{}/{}/{}'.format(today.month, today.day, today.year)
# date= time[(time.find("-")+1):time.find("T")]
# print date
today = datetime.date.today()
date = '{}/{}/{}'.format(today.month, today.day, today.year)
# time = [meta.get('content') for meta in h_link_soup.find_all('meta', itemprop='datePublished')]
# if time:
# date = time[0][:time[0].find("T")]
# else:
# today = datetime.date.today()
# date = '{}/{}/{}'.format(today.month, today.day, today.year)

if url_image is not None:
image = url_image.get('content')
if image is None or image == '':
Expand Down

0 comments on commit af18770

Please sign in to comment.