Skip to content

Commit

Permalink
feat: 设置正常的请求头
Browse files Browse the repository at this point in the history
  • Loading branch information
14790897 committed Apr 4, 2024
1 parent 32d4637 commit 3eb58de
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pteer.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ require("dotenv").config();
const browser = await puppeteer.launch({
headless: true,
args: ["--no-sandbox", "--disable-setuid-sandbox"], //linuzx需要
defaultViewport: { width: 1920, height: 1080 },
defaultViewport: {
width: 1280,
height: 800,
userAgent:
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36",
},
});
const page = await browser.newPage();
page.on("pageerror", (error) => {
Expand Down

0 comments on commit 3eb58de

Please sign in to comment.