python-cdp icon indicating copy to clipboard operation
python-cdp copied to clipboard

Can't get cdp.dom.get_document() when network.enable()

Open jonaspiresnt opened this issue 1 year ago • 2 comments

In Chrome 128 cdp.dom.get_document() freezes when network.enable().

jonaspiresnt avatar Aug 28 '24 10:08 jonaspiresnt

I made it work by editing the pycdp/cdp/util.py file, in the parse_json_event method.

if json['method'] != 'Network.policyUpdated': return _event_parsers[json['method']].from_json(json['params'])

jonaspiresnt avatar Aug 28 '24 11:08 jonaspiresnt

This probably happens because the CDP API doesn't match the wrapper layer of pycdp. This is generally fixed by updating the wrappers (see Updating built-in CDP wrappers section in the README) - which regenerates the python files in pycdp/cdp. So you still need to fork the repo, or locally install it, and then update the python code.

RazorBest avatar Aug 10 '25 01:08 RazorBest