我和木偶师一起启动了chrome浏览器,但是我无法启动它。有人能帮助我正确地选择chrome.exe文件的路径吗?
发布于 2022-08-28 18:55:58
您必须添加chrome.exe所在文件夹的路径。
假设chrome.exe位于具有以下路径的文件夹中:
C:\程序文件\Google\Chrome\Application
然后,选择文件夹的正确方法是:
const browser = await puppeteer.launch({
executablePath: 'C:\\Program Files\\Google\\Chrome\\Application'
headless: true
});(使用双反斜杠的原因是反斜杠用于转义字符。)
在Linux或Mac中,假设chrome所在的路径是:
/usr/bin/google-chrome
然后,选择文件夹的正确方法是:
const browser = await puppeteer.launch({
executablePath: '/usr/bin/google-chrome'
headless: true
});https://stackoverflow.com/questions/73519086
复制相似问题