你的密码是
headless: false
,以及一个名为
--headless
也就是说
headless: true
.木偶演员会感到困惑。
撇开玩笑不谈,以下是我在“网络”选项卡上看到的内容。
“网络”选项卡表示它至少加载66个请求,其中至少包含或超过
1.5s
对于每个资源(idk为什么在我的默认chrome上加载较慢)。
来自a的相同
page load test (click to see the report)
,基本上说它在40多秒钟内加载170多个请求。
默认超时为30秒,但加载数据的时间超过90秒。
下面是处理导航超时的参数。
await page.goto('https://www.arelplane.com/@arelenglish', {"waitUntil" : "networkidle0", "timeout": 0}); // timeout: 0 will disable navigation timeout
禁用超时或将其增加到120秒或该范围内的其他值。这是我的密码,
puppeteer.launch({headless: false}).then(async browser => {
const page = await browser.newPage();
await page.goto('https://www.arelplane.com/@arelenglish', {"waitUntil" : "networkidle0", "timeout": 0});
await page.screenshot({path: "test.png"});
await browser.close();
});
结果如下:,