diff --git a/src/utils.py b/src/utils.py index 34b87a8..1816247 100644 --- a/src/utils.py +++ b/src/utils.py @@ -27,19 +27,14 @@ def get_sb( detail="SOCKS5 proxy with authentication is not supported. Check README for more info.", ) - sb_ctx = SB( + with SB( uc=True, headless=USE_HEADLESS, locale_code="en", ad_block=True, proxy=proxy, - ) - sb = sb_ctx.__enter__() - try: + ) as sb: yield sb - finally: - sb_ctx.__exit__(None, None, None) - def save_screenshot(sb: BaseCase):