From 4d5e816dd452ce0a8e568b99e57a58208daa5188 Mon Sep 17 00:00:00 2001 From: Bluefissure Date: Mon, 31 Oct 2022 22:30:41 -0500 Subject: [PATCH] fix: fast return if url is None --- scrapinglib/parser.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scrapinglib/parser.py b/scrapinglib/parser.py index 8806036..dbbf8e4 100644 --- a/scrapinglib/parser.py +++ b/scrapinglib/parser.py @@ -84,6 +84,8 @@ class Parser: self.detailurl = self.specifiedUrl else: self.detailurl = self.queryNumberUrl(number) + if not self.detailurl: + return None htmltree = self.getHtmlTree(self.detailurl) result = self.dictformat(htmltree) return result