ClericPy / ichrome

Chrome controller for Humans, based on Chrome Devtools Protocol(CDP) and python3.7+.
https://pypi.org/project/ichrome/
MIT License
227 stars 29 forks source link

能实现page.setRequestInterception吗? #122

Closed tmxd09887 closed 1 year ago

tmxd09887 commented 1 year ago

类似puppeteer的page.setRequestInterception

想这样使用 await page.setRequestInterception(true) page.on('request', async request => { if (...){}else{ request.continue() } })

ClericPy commented 1 year ago

https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-setRequestInterception

Sets the requests to intercept that match the provided patterns and optionally resource types. Deprecated, please use Fetch.enable instead.

早就弃用了吧, 改用 Fetch 吧 https://clericpy.github.io/ichrome/reference/AsyncTab/#ichrome.async_utils.AsyncTab.iter_fetch

或者自己 tab.send 试试