我想用铬代替铬。我可以通过提供可执行路径在木偶中实现相同的目标。在剧作家中,它不起作用,因为浏览器类型参数仅支持“铬,网络套件,火狐”
const { chromium } = require('playwright');
(async () => {
const browser = await chromium.launch({
headless: false,
executablePath: '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',
});
const context = await browser.newContext();
const page = await context.newPage();
await page.goto('http://whatsmyuseragent.org/');
await page.screenshot({ path: `example-${browserType}.png` });
})();
aluckdog
慕少森
宝慕林4294392
相关分类