Error: No data found for resource with given identifier
See original GitHub issuePerhaps you can help me with this, I try to get body from some ajax request on the page, but I all time getting Error: No data found for resource with given identifier
and looks like problem only with this request, maybe I’m missing something
const CDP = require('chrome-remote-interface');
setTimeout(() => {
CDP(async (client) => {
const {Network, Page, Runtime} = client;
Network.requestWillBeSent(({requestId, request}) => {
if(request.url.indexOf("ct2/results/rpc") != -1){
console.log(`REQ [${requestId}] ${request.method} ${request.url} \n`);
}
});
Network.responseReceived(async ({requestId, response}) => {
if(response.url.indexOf("ct2/results/rpc") != -1){
const {body, base64Encoded} = await Network.getResponseBody({requestId});
console.log(`RES [${requestId}] body: ${body} \n`);
}
});
try {
await Promise.all([Network.enable(), Page.enable()]);
await Page.navigate({url: 'https://clinicaltrials.gov/ct2/results?cond=Parents&term=&cntry1=&state1=&Search=Search&recrs=a#wrapper'});
await Page.loadEventFired();
await Runtime.evaluate({
expression: `document.querySelector('.paginate_button.next').click()`
});
} catch (err) {
console.error(err);
}
}).on('error', (err) => {
console.error(err);
});
}, 1000);
Thanks.
Issue Analytics
- State:
- Created 6 years ago
- Comments:24 (9 by maintainers)
Top Results From Across the Web
Chrome Extension: "No resource with given identifier found ...
To solve this, just use a single debugger and do not detach it, or only detach when it's safe to. var gAttached =...
Read more >Can't get API to work - JavaScript - The freeCodeCamp Forum
The response section simply says “Failed to load response data: no data found for resource with given identifier.”
Read more >[HTTP Request Error] Failed to load response data
[HTTP Request Error] Failed to load response data ... Body: Failed to load response data: No data found for resource with given identifier....
Read more >Chrome Extension: “No resource with given identifier found ...
I'm writing a Chrome Extension that can get HTTP response for a site. I try to use debugger for getting response body: var...
Read more >How to Fix Chrome's Failed to Load Response Data Error
2. Add a breakpoint in the Sources tab · In Chrome DevTools, click on the Sources tab.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This happens because AFAIK you’re only allowed to call
Network.getResponseBody
when theNetwork.loadingFinished
event has fired. Unfortunately this event doesn’t contain the associated request object so you have to keep track of therequestId
for which you want to fetch the response body.I implemented this in the following using a
Set
:Thank you very much for your help, only you are helping people)