Version
1.60.0
Steps to reproduce
Run the code:
from playwright.sync_api import sync_playwright
url = 'https://ams.download.datapacket.com/100mb.bin'
output_path = '100mb.bin'
with sync_playwright() as playwright:
browser = playwright.chromium.launch(headless=False, args=['--start-maximized'], slow_mo=2000)
context = browser.new_context(no_viewport=True)
page = context.new_page()
with page.expect_download(timeout=60000) as download_info:
page.goto(url=url)
download = download_info.value
download.save_as(path=output_path)
Expected behavior
Download is completed.
Actual behavior
Exception has occurred: Error
Page.goto: Download is starting
Call log:
Additional context
If I enclose page.goto(url=url) within try-except (please see below), then no error occurs.
try:
page.goto(url=url)
except:
pass
Environment
- Operating System: [Windows 10 22H2]
- CPU: [x86-64]
- Browser: [Chromium]
- Python Version: [3.13.13]
- Other info:
Version
1.60.0
Steps to reproduce
Run the code:
Expected behavior
Download is completed.
Actual behavior
Exception has occurred: Error
Page.goto: Download is starting
Call log:
playwright._impl._errors.Error: Download is starting
Call log:
Additional context
If I enclose page.goto(url=url) within try-except (please see below), then no error occurs.
Environment