Ich baue einen Crawler mit Headless-Browser Aber im Moment möchte ich meine App, die ich installiert habe, in meinem Docker-Bild chromed Aber es wirft mir einen Fehler, wenn Sie das Skript ausführen.Wie führe ich kopflose Browser im Docker?
StartChrome.js
const chromeLauncher = require('chrome-launcher');
chromeLauncher.launch({
port: 9222,
chromeFlags: ['--headless','--proxy-server=54.171.181.204:8888','--disable-web-security','--disable-gpu']
}).then(chrome => {
console.log(`Chrome debugging port running on ${chrome.port}`);
});
Err
(node:415) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: connect ECONNREFUSED 127.0.0.1:9222
(node:415) [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.
Und wenn ich es in der Kommandozeile ausführen wirft es mir einen Fehler wie diese
Failed to move to new namespace: PID namespaces supported, Network namespace supported, but failed: errno = Operation not permitted
Trace/breakpoint trap
Nein ich möchte wissen, wie es unter der Haube funktioniert. – Nane