From 3bc58b64be8cb22833a53eb9299f67b6363ad8ae Mon Sep 17 00:00:00 2001 From: Ben Busby Date: Sat, 25 Apr 2020 11:32:43 -0600 Subject: [PATCH] Small update to filter class The image results page seems to have different formatting from non-image results pages. Should probably revisit this at some point and try to style the image results page to be more in line with other result types. --- app/filter.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/filter.py b/app/filter.py index c15ee42..9d41837 100644 --- a/app/filter.py +++ b/app/filter.py @@ -52,9 +52,11 @@ class Filter: logo['style'] = 'display:flex; justify-content:center; align-items:center; color:#685e79; font-size:18px;' # Fix search bar length on mobile - if self.mobile: + try: search_bar = soup.find('header').find('form').find('div') search_bar['style'] = 'width: 100%;' + except AttributeError: + pass # Replace hrefs with only the intended destination (no "utm" type tags) for a in soup.find_all('a', href=True):