diff --git a/database.py b/database.py index e379183..cef6fc9 100644 --- a/database.py +++ b/database.py @@ -35,7 +35,8 @@ def scrape_feed(feed_url): meta = {} meta['title'] = soup.title.text - meta['html_url'] = soup.find("link", href="").text + #meta['html_url'] = soup.find("link", href="").text + meta['html_url'] = soup.find("link", string=re.compile(".")).text meta['html_url'] = meta['html_url'].replace('http://', 'https://') meta['description'] = soup.description.text @@ -76,7 +77,7 @@ def scrape_zombie_knight(soup): entry_dict['title'] = entry.title.text entry_dict['link'] = entry.find("link", rel='alternate').get('href') date = entry.updated.text - date = "".join(re.search("(.*)\.\d{3}(.\d{2}):(\d{2})", date).groups()) + date = "".join(re.search(r"(.*)\.\d{3}(.\d{2}):(\d{2})", date).groups()) date = time.strptime(date, '%Y-%m-%dT%H:%M:%S%z') entry_dict['date'] = time.strftime('%Y-%m-%d', date) entry_dict['description'] = entry.content.text[:200]