HyperionGray / trio-chrome-devtools-protocol

Trio driver for Chrome DevTools Protocol (CDP)
MIT License
62 stars 18 forks source link

how to get response data while scrolling #10

Closed sloev closed 4 years ago

sloev commented 4 years ago

i am trying to enable network to start receiving response events with:

await session.execute(network.enable())
requests =  session.listen(network.RequestWillBeSent)
async for r in requests:
    print(r, flush=True)

but i dont make it past the point of enabling network:

blocked_reason=CookieBlockedReason.from_json(json['blockedReason']),
KeyError: 'blockedReason'

can you supply an example of how to get response data while scrolling ?

mehaase commented 4 years ago

There's not enough code in your example for me to try to reproduce this, but my guess is that you are using an incompatible browser. I'm using Chromium Version 77.0.3855.0 on Linux. You can find links to download here: https://py-cdp.readthedocs.io/en/latest/overview.html

sloev commented 4 years ago

i swtched to use pyppeteer and an osx script for starting chrome instead: https://github.com/sloev/slackdump

thanks for the answer though! ✋