Puppeteer:如何使用 chrome 无头浏览器 api 下载文件? [英] Puppeteer: How do I download a file using chrome headless browser api?

查看:61
本文介绍了Puppeteer:如何使用 chrome 无头浏览器 api 下载文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 Puppeteer,如何让无头 chrome 浏览器下载文件(或发出额外的 http 请求并保存响应)?

Using Puppeteer, how do I get the headless chrome browser to download a file (or make additional http requests and save the response)?

推荐答案

这是我编写的一个工具,用于下载页面在加载时使用的所有资源.

Here's a tool I wrote to download all the resources that a page uses upon load.

此节点命令行实用程序使用无头浏览器 (Puppeteer) 来呈现网页并下载它可能需要的所有资源.这些资源包括原始HTML都保存在本地...

This node command-line utility uses a headless browser (Puppeteer) to render a webpage and download all resources it may need. These resources including the original HTML are all saved locally...

https://github.com/stav/wgrep

这篇关于Puppeteer:如何使用 chrome 无头浏览器 api 下载文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆