From 8377087d7572729f4e227d40c0a3f32fb5b2720a Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 12 Aug 2019 11:42:32 +0200 Subject: Fix missing domains --- commcrawler/scrapy.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'commcrawler/scrapy.py') diff --git a/commcrawler/scrapy.py b/commcrawler/scrapy.py index 767827a..7702ea6 100644 --- a/commcrawler/scrapy.py +++ b/commcrawler/scrapy.py @@ -296,7 +296,8 @@ def launch_match(crawl_item): "pk", "target_id", "target__url").all(): if subresult["pk"] == result["pk"]: continue - if get_domain(subresult["target__url"]) in domains: + url = subresult["target__url"] + if url and get_domain(url) in domains: rel, created = models.CrawlRelation.objects.get_or_create( crawl_id=crawl_item.pk, source_id=result["target_id"], destination_id=subresult["target_id"]) -- cgit v1.2.3