def _save_articles(self, batch): link_list = self.fetch_list_by_scrape(site_url=batch.target_url, target_extract_condition=batch.link_extract) for link in link_list: # print("URL情報:"+link.attrs['href']) try: title = self.fetch_list_by_scrape(site_url=link.attrs['href'], target_extract_condition=batch. title_extract).get_text() except ValueError: continue except AttributeError: continue article = Article() article.title = title article.link = link.attrs['href'] article.source = batch.source article.category = batch.category article.pub_date = timezone.now() article.save()