Commit 8783cf66 authored by 姚广胤's avatar 姚广胤

测试utf-8

parent ab56688c
......@@ -26,13 +26,14 @@ puppeteer.launch({
});
// tab访问需要截图的页面,使用await可以等待页面加载完毕
await page.goto(websiteUrl);
const response = await page.goto(websiteUrl);
await page.setContent((await response.buffer()).toString('utf8'));
// 由于页面数据是异步的,所以等待8秒,等待异步请求完毕,页面渲染完毕
await page.waitFor(8000)
// 页面渲染完毕后,开始截图
await page.screenshot({
path: './xxx1.png',
path: './xxx2.png',
clip: {
x: 0,
y: 0,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment