If (request.Jest args: -e2e -spec -max-workers=36Īt ChildProcess.spawn (internal/child_process.js:394:11) cancel any navigation requests after the initial page.goto const browser = await puppeteer.launch() Therefore the buffers of the resources are not cleared. This means, any reload or navigation on the page will not work. This solution cancels any navigation requests after the initial request. There is a simple solutions, which might get you started, but might not always work and a more complex solution to this problem. To do this we can use tRequestInterception. To solve this problem, you need to make sure that the page does not make any navigation requests as long as you have not finished downloading your resource. This might be a redirect or page reload in your case. The problem is, that the buffer is cleared as soon as any kind of navigation request is happening. My question is: Is there some way (using puppeteer), to intercept the download stream without having to save the file to disk before? I noticed that some people use a solution based on reading files, in the other words, after download finishes, them read the stored file from the disk. I'm not sure if that's the correct approach. With such code above, I would intend to detect the event of the download dialog and then, in some way, be able to receive the binary content. I tried (unsuccessfully) to use the page.on("response") event to retrieve the raw response content, acording the following snippet: const bucket = Īwait page.on("response", async response => Looking for some examples in the web, I noticed that there is a lot of people with this problem. So far I wasn't able to find out some solution. I want to get the download content (buffer) and after soon, store the data at my S3 account.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |