I´m having an issue with puppeteer. So what I want to do is to launch a website and login. However, this website tries to load a resource which is blocked because its insecure. After running the code I get this error message and the code stops running:
(node:11684) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: SSL Certificate error: ERR_CERT_COMMON_NAME_INVALID
(node:11684) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
My code:
'use strict';
const puppeteer = require('puppeteer');
async function Login(username, password){
const browser = await puppeteer.launch({
headless: false
});
const page = await browser.newPage();
await page.goto('', {waitUntil: 'networkidle'});
/*await page.type(username);
await page.focus('#pass');
await page.type(password);
await page.click('#send2');*/
await browser.close();
}
Login('xxx', 'xxx');
This is what the chrome consule puts out:
Failed to load resource: net::ERR_INSECURE_RESPONSE
My enviroment: Latest Puppeteer version / Windows 10
I´m having an issue with puppeteer. So what I want to do is to launch a website and login. However, this website tries to load a resource which is blocked because its insecure. After running the code I get this error message and the code stops running:
(node:11684) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: SSL Certificate error: ERR_CERT_COMMON_NAME_INVALID
(node:11684) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
My code:
'use strict';
const puppeteer = require('puppeteer');
async function Login(username, password){
const browser = await puppeteer.launch({
headless: false
});
const page = await browser.newPage();
await page.goto('https://shop.adidas.ae/en/customer/account/login', {waitUntil: 'networkidle'});
/*await page.type(username);
await page.focus('#pass');
await page.type(password);
await page.click('#send2');*/
await browser.close();
}
Login('xxx', 'xxx');
This is what the chrome consule puts out:
Failed to load resource: net::ERR_INSECURE_RESPONSE
My enviroment: Latest Puppeteer version / Windows 10
Share Improve this question edited Sep 24, 2017 at 14:13 Ori Marko 58.8k26 gold badges152 silver badges257 bronze badges asked Sep 24, 2017 at 14:12 NoahNoah 6812 gold badges8 silver badges17 bronze badges1 Answer
Reset to default 18Set ignoreHTTPSErrors: true
. Beware: this will ignore all SSL errors.
'use strict';
const puppeteer = require('puppeteer');
async function Login(username, password){
const browser = await puppeteer.launch({
headless: false,
ignoreHTTPSErrors: true
});
const page = await browser.newPage();
await page.goto('https://shop.adidas.ae/en/customer/account/login', {waitUntil: 'networkidle'});
/*await page.type(username);
await page.focus('#pass');
await page.type(password);
await page.click('#send2');*/
await browser.close();
}
Login('xxx', 'xxx');