From ce83bffc6e52bf0831a3f60a35e2fa16cf569a7f Mon Sep 17 00:00:00 2001 From: DUO Labs Date: Tue, 1 Feb 2022 20:28:42 -0500 Subject: [PATCH] Update minimal mode for new Google formatting --- app/filter.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/filter.py b/app/filter.py index df8f243..568cb78 100644 --- a/app/filter.py +++ b/app/filter.py @@ -12,6 +12,7 @@ import urllib.parse as urlparse from urllib.parse import parse_qs import os +minimal_mode_sections = ['Top stories','Images','People also ask'] def extract_q(q_str: str, href: str) -> str: """Extracts the 'q' element from a result link. This is typically @@ -169,8 +170,11 @@ class Filter: for result in self.main_divs: result_children = pull_child_divs(result) if minimal_mode: - if len(result_children) in (1, 3): - continue + if any(f">{x}