Skip to content

Commit ae6d7b7

Browse files
committed
Update download handling
1 parent 54332fb commit ae6d7b7

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

scrapy_playwright/handler.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,8 +600,7 @@ async def _handle_response(response: PlaywrightResponse) -> None:
600600
response = await page.goto(url=request.url, **page_goto_kwargs)
601601
except PlaywrightError as err:
602602
if not (
603-
self.config.browser_type_name in ("firefox", "webkit")
604-
and "Download is starting" in err.message
603+
"Download is starting" in err.message
605604
or self.config.browser_type_name == "chromium"
606605
and "net::ERR_ABORTED" in err.message
607606
):

tests/tests_asyncio/test_playwright_requests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ async def test_download_file_delay_error(self):
499499
@allow_windows
500500
async def test_download_file_failure(self):
501501
if self.browser_type != "chromium":
502-
pytest.skip()
502+
pytest.skip("Test only on Chromium")
503503

504504
async def cancel_download(download):
505505
await download.cancel()

0 commit comments

Comments
 (0)