Closed leksito closed 5 years ago
I think you are supposed to call Page.navigate
directly with the sessionid
@leksito Pease check out the https://github.com/aslushnikov/getting-started-with-cdp/ on how to use Flatten protocol.
@aslushnikov but when i use as in your article, i get another error:
{u'sessionId': u'ECC037FD6FBE59522113CABDA0A9ABC0', u'id': 2, u'error': {u'message': u"'Page.enable' wasn't found", u'code': -32601}}
Another example. Message that i send via ws:
{'sessionId': u'B7AF31201C0E716F891BC294689E936D', 'params': {'url': 'https://www.google.com'}, 'id': 2, 'method': 'Page.navigate'}
Error:
{'sessionId': u'B7AF31201C0E716F891BC294689E936D', 'params': {'url': 'https://www.google.com'}, 'id': 2, 'method': 'Page.navigate'}
But when i use 'attachToTarget' method it works.
http://localhost:9222/json/list
I'm use Target.attachToBrowserTarget to get sessionId:
{'id': 1001, 'result': {'sessionId': '81DD0C3461871103A0467DD8D0393E2C'}}
then I use Target.sendMessageToTarget to navigate using Page.navigate:
and get the error "When using flat protocol, messages are routed to the target via the sessionId attribute.".
What is mean flat sessionId mode? Why I got this error if sessionId is defined?