Jun-12-2019, 05:36 AM
(Jun-11-2019, 11:40 PM)Biks Wrote: It seems I could just findAll <datepub> tags with BeautifulSoup and match it today's dateYou could to that.
Now will task work fine from feedparser to.
If just set a range() to number like eg 10 and loop.
>>> for n in range(10): ... dgtw['entries'][n]['published'] ... 'Tue, 11 Jun 2019 16:07:41 GMT' 'Tue, 11 Jun 2019 15:03:52 GMT' 'Tue, 11 Jun 2019 14:43:21 GMT' 'Tue, 11 Jun 2019 13:58:31 GMT' 'Tue, 11 Jun 2019 12:24:25 GMT' 'Tue, 11 Jun 2019 03:13:45 GMT' 'Mon, 10 Jun 2019 21:56:47 GMT' 'Mon, 10 Jun 2019 19:58:24 GMT' 'Mon, 10 Jun 2019 19:38:59 GMT' 'Mon, 10 Jun 2019 14:07:38 GMT'So see that there is 6 entries today.
Then can just do a quick hack.
>>> from datetime import datetime >>> >>> today = datetime.today().day >>> today 12 >>> today_match = f', {today}' >>> today_match ', 12'when have
', 12'
can just use in
to look if there is a match in published date string.>>> today_match = ', 11' >>> count = 0 >>> for n in range(10): ... p_date = dgtw['entries'][n]['published'] ... if today_match in p_date: ... count += 1 ... >>> count 6