Style of ss

pull/1873/head
KyleBoyer 2 years ago
parent bcbb531730
commit adafdba114

@ -140,9 +140,26 @@ def get_title_screenshot(reddit_object: dict):
) )
else: else:
print_substep("Skipping translation...") print_substep("Skipping translation...")
# Removes the body of the post
page.evaluate( page.evaluate(
"document.querySelector('[data-adclicklocation=\"media\"]').style.display = 'none'" "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" postcontentpath = f"assets/temp/{reddit_id}/png/title.png"
try: try:

Loading…
Cancel
Save