From adafdba114031f0defcf44837d068810d98585db Mon Sep 17 00:00:00 2001 From: KyleBoyer Date: Thu, 23 Nov 2023 01:37:00 -0600 Subject: [PATCH] Style of ss --- utils/imagenarator.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/utils/imagenarator.py b/utils/imagenarator.py index 0d088b0..289f8cd 100644 --- a/utils/imagenarator.py +++ b/utils/imagenarator.py @@ -140,9 +140,26 @@ def get_title_screenshot(reddit_object: dict): ) else: print_substep("Skipping translation...") + # Removes the body of the post page.evaluate( "document.querySelector('[data-adclicklocation=\"media\"]').style.display = 'none'" ) + # Removes the notify bell icon + page.evaluate( + "document.querySelector('[data-test-id=\"post-content\"] > div > button').style.display='none'" + ) + # Removes the # comments/share/... buttons + page.evaluate( + "document.querySelector('[data-adclicklocation=\"media\"]').nextElementSibling.style.display='none'" + ) + # Makes the title screenshot sized better because alert bell is hidden + page.evaluate( + "document.querySelector('[data-adclicklocation=\"media\"]').parentElement.style.width='fit-content'" + ) + # Adds spacing around box to display more nicely + page.evaluate( + "document.querySelector('[data-test-id=\"post-content\"]').style.padding = '1px 1px 1px 1px'" + ) postcontentpath = f"assets/temp/{reddit_id}/png/title.png" try: