修复了扑飞 不加载图片
This commit is contained in:
parent
24c682dcf4
commit
d80c21fcd8
@ -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) {
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user