fix(shell): Fix view command edge case
This commit is contained in:
@@ -317,8 +317,8 @@ def show_page_in_browser(page: Selector): # pragma: no cover
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
fd, fname = make_temp_file(prefix="scrapling_view_", suffix=".html")
|
fd, fname = make_temp_file(prefix="scrapling_view_", suffix=".html")
|
||||||
with open(fd, "wb") as f:
|
with open(fd, "w", encoding=page.encoding) as f:
|
||||||
f.write(page.body)
|
f.write(page.html_content)
|
||||||
|
|
||||||
open_in_browser(f"file://{fname}")
|
open_in_browser(f"file://{fname}")
|
||||||
except IOError as e:
|
except IOError as e:
|
||||||
|
|||||||
Reference in New Issue
Block a user