【发布时间】:2020-04-12 16:28:42
【问题描述】:
我知道Fetch Domain 用于此目的,但我不知道我该如何实现它。在 Selenium python 中,我使用以下代码来启用requestPaused 事件的发布。
driver.execute_cdp_cmd("Fetch.enable",{})
driver.get('https://www.example.com')
但我不知道如何处理requestPaused 事件(我需要调用一个fulfillRequest 或continueRequest/continueWithAuth)。结果,我的程序停止工作。
如果有人能给我提供一个例子来帮助我理解它是如何工作的,我真的很感激。
【问题讨论】:
-
我不确定它是否可以完成。无论如何,大多数请求仍将使用 xhr 而不是 fetch。
标签: selenium google-chrome-devtools fetch-api chrome-devtools-protocol selenium4