Commit dec91658 authored by 姚广胤's avatar 姚广胤

去掉编码验证

parent 8783cf66
......@@ -27,13 +27,13 @@ puppeteer.launch({
// tab访问需要截图的页面,使用await可以等待页面加载完毕
const response = await page.goto(websiteUrl);
await page.setContent((await response.buffer()).toString('utf8'));
// await page.setContent((await response.buffer()).toString('utf8'));
// 由于页面数据是异步的,所以等待8秒,等待异步请求完毕,页面渲染完毕
await page.waitFor(8000)
// 页面渲染完毕后,开始截图
await page.screenshot({
path: './xxx2.png',
path: './xxx3.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