scrapy-plugins / scrapy-playwright

🎭 Playwright integration for Scrapy
BSD 3-Clause "New" or "Revised" License
992 stars 108 forks source link

How to disable file download? #261

Closed NiuBlibing closed 8 months ago

NiuBlibing commented 8 months ago

Hi, I'm using scarpy-playwight to do common crawling which some url maybe a very large file download link.The files is auto download to path like /tmp/playwright-artifacts-p5tOHg/310a6a9c-c2cb-4b29-8a42-fe7c6f0de8ec and consumes a lot of disk IO and bandwidth. Is there a way to disable it?

elacuesta commented 8 months ago

Have you checked PLAYWRIGHT_ABORT_REQUEST?

elacuesta commented 8 months ago

Another possibility might be to handle the download event with playwright_page_event_handlers and cancel it.

NiuBlibing commented 8 months ago

Thanks, playwright_page_event_handlers works for me.