From d80c21fcd854694d0c97288fd449801899651b78 Mon Sep 17 00:00:00 2001 From: luyuan <1162963624@qq.com> Date: Fri, 18 Dec 2020 15:19:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E6=89=91=E9=A3=9E?= =?UTF-8?q?=20=E4=B8=8D=E5=8A=A0=E8=BD=BD=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/reptile/pufei_net/find.js | 7 +++++-- bin/reptile/taduo_net/find.js | 6 ++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/bin/reptile/pufei_net/find.js b/bin/reptile/pufei_net/find.js index 84c3fde..c6c55a5 100644 --- a/bin/reptile/pufei_net/find.js +++ b/bin/reptile/pufei_net/find.js @@ -4,11 +4,14 @@ let mainurl = "http://www.alimanhua.com/" let gethtml = (name) => { return new Promise(async (res, rej) => { puppeteer.launch({ - headless: true, - args: ['--no-sandbox', '--disable-setuid-sandbox'] + headless: false, + args: ['--no-sandbox', '--disable-setuid-sandbox','--blink-settings=imagesEnabled=false'] }).then(async (browser) => { const page = await browser.newPage(); + await page.evaluateOnNewDocument(() => { + Object.defineProperty(navigator, 'webdriver', { get: ()=> false }); + }); try { await page.goto(mainurl); } catch (error) { diff --git a/bin/reptile/taduo_net/find.js b/bin/reptile/taduo_net/find.js index cbc081c..6b2d8f9 100644 --- a/bin/reptile/taduo_net/find.js +++ b/bin/reptile/taduo_net/find.js @@ -5,11 +5,13 @@ let gethtml = (name) => { return new Promise(async (res, rej) => { puppeteer.launch({ headless: true, - args: ['--no-sandbox', '--disable-setuid-sandbox'] + args: ['--no-sandbox', '--disable-setuid-sandbox','--blink-settings=imagesEnabled=false'] }).then(async (browser) => { const page = await browser.newPage(); - + await page.evaluateOnNewDocument(() => { + Object.defineProperty(navigator, 'webdriver', { get: ()=> false }); + }); // await page.goto(mainurl); try { await page.goto(mainurl);