You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The contents of the JSON responses returned by chrome need to be accessed via the result key.
Currently the return statements created by the generator (example: return Node.from_json(json['root'])) will raise a KeyError.
To fix this, return statements should be changed to Node.from_json(json['result']['root'])
Can you point me to what part of the generator code handles this? I can fix it and create a pull request.
The text was updated successfully, but these errors were encountered:
This actually hasn't changed. The result key is part of the JSON RPC-ish protocol that Chrome speaks. This project assumes that you implement the RPC framing in a higher level library (but see #12 as a potential change there), so at that higher level you would unpack the response, check for errors, and if everything was okay, then you'd convert the json['result'] to a native Python CDP type.
I don't think we could add the ['result'] in this project right now even if we wanted to, because from_json() is used recursively, i.e. objects will call this to create objects out of subdictionaries, and those subdictionaries won't have a result key in them.
The contents of the JSON responses returned by chrome need to be accessed via the
result
key.Currently the return statements created by the generator (example:
return Node.from_json(json['root'])
) will raise a KeyError.To fix this, return statements should be changed to
Node.from_json(json['result']['root'])
Can you point me to what part of the generator code handles this? I can fix it and create a pull request.
The text was updated successfully, but these errors were encountered: