diff --git a/core/scraping/uztracker_scraper.py b/core/scraping/uztracker_scraper.py index 6ee9c04..f40842b 100644 --- a/core/scraping/uztracker_scraper.py +++ b/core/scraping/uztracker_scraper.py @@ -52,10 +52,8 @@ def scrape_uztracker(search, debug): return resulttitles, results if not result: - if debug: - print(f'No Results found for "{search}"') # add popup in gui for no result - return + return None except requests.RequestException as e: if result: diff --git a/core/ui/gui.py b/core/ui/gui.py index a498e31..c72d2ac 100644 --- a/core/ui/gui.py +++ b/core/ui/gui.py @@ -122,12 +122,19 @@ class MainWindow(QtWidgets.QMainWindow, QWidget): def return_pressed(self): search_text = self.searchbar.text() - self.postnames, self.postlinks = scrape_uztracker(search_text, debug) - self.softwareList.clear() - if self.postnames: - self.softwareList.addItems(self.postnames) if debug: print("User searched for:", search_text) + + response = scrape_uztracker(search_text, debug) + if response: + self.postnames, self.postlinks = response + self.softwareList.clear() + if self.postnames: + self.softwareList.addItems(self.postnames) + elif debug: + print(f"No Results found for \"{search_text}\"") + +