Closed ClericPy closed 2 years ago
import asyncio
import json
from ichrome import AsyncChromeDaemon
async def main():
async with AsyncChromeDaemon() as cd:
async with cd.connect_tab() as tab:
async with tab.iter_fetch(timeout=5) as f:
await tab.goto('http://httpbin.org/get', timeout=0)
async for request in f:
print(json.dumps(request))
await f.continueRequest(request)
if __name__ == "__main__":
asyncio.run(main())
https://chromedevtools.github.io/devtools-protocol/tot/Fetch/#method-enable