Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Protocol error (Network.getResponseBody): No resource with given identifier foundError #3617

Closed
oleksii-hryhurko opened this issue Aug 25, 2020 · 1 comment

Comments

@oleksii-hryhurko
Copy link

oleksii-hryhurko commented Aug 25, 2020

Hi i am trying to write something like network listener but sometimes i get this error, can you help me solve this problem:
Playwright v. 1.3.0
Code:
page.on('response', response => { if (response.url().endsWith('api/2/json')) { response.body().then(body => { console.log(response.request().postData()) console.log(res.toString()) }) } })
Stacktrace:
Protocol error (Network.getResponseBody): No resource with given identifier foundError: at node_modules/playwright/lib/chromium/crConnection.js:131:63 at CRSession.send (node_modules/playwright/lib/chromium/crConnection.js:130:16) at CRSession.send (node_modules/playwright/lib/helper.js:80:31) at Response.getResponseBody [as _getResponseBodyCallback] (node_modules/playwright/lib/chromium/crNetworkManager.js:218:49) at node_modules/playwright/lib/network.js:233:29

@pavelfeldman
Copy link
Member

It might happen when the page navigates to a new url. We only allow fetching resource body while on the same page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants