From bf5fe6d45189df443b2d2675f7475887bef785d3 Mon Sep 17 00:00:00 2001 From: Karim shoair Date: Fri, 19 Sep 2025 04:21:15 +0300 Subject: [PATCH] fix(shell): Fix `view` command edge case --- scrapling/core/shell.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scrapling/core/shell.py b/scrapling/core/shell.py index 1bd67ea..4cca171 100644 --- a/scrapling/core/shell.py +++ b/scrapling/core/shell.py @@ -317,8 +317,8 @@ def show_page_in_browser(page: Selector): # pragma: no cover try: fd, fname = make_temp_file(prefix="scrapling_view_", suffix=".html") - with open(fd, "wb") as f: - f.write(page.body) + with open(fd, "w", encoding=page.encoding) as f: + f.write(page.html_content) open_in_browser(f"file://{fname}") except IOError as e: