pevers / images-scraper

Simple and fast scraper for Google
ISC License
224 stars 69 forks source link

Error: Failed to launch chrome! [7540:10164:0129/180956.284:FATAL:content_main_runner_impl.cc(526)] --single-process is not supported in chrome multiple dll browser. #41

Closed ghost closed 4 years ago

ghost commented 4 years ago

I'm getting this error with the default example: Windows 7 64bit Node.js 12.13.0

var Scraper = require ('images-scraper');

let google = new Scraper.Google({
    keyword: 'cat',
    limit: 5,
    puppeteer: {
        headless: false
    },
  tbs: {
        // every possible tbs search option, some examples and more info: http://jwebnet.net/advancedgooglesearch.html
    isz: 'm',               // options: l(arge), m(edium), i(cons), etc. 
    itp: undefined,                 // options: clipart, face, lineart, news, photo
        ic: undefined,                  // options: color, gray, trans
        sur: undefined,                 // options: fmc (commercial reuse with modification), fc (commercial reuse), fm (noncommercial reuse with modification), f (noncommercial reuse)
  }
});

(async () => {
    const results = await google.start();
   console.log('results',results);
  // sendMessage({message: 'image', body: results});
})();
(node:10852) UnhandledPromiseRejectionWarning: Error: Failed to launch chrome!
[7540:10164:0129/180956.284:FATAL:content_main_runner_impl.cc(526)] --single-process is not supported in chrome multiple dll browser.
Backtrace:
    ovly_debug_event [0x000007FEC5505E12+15744418]
    ovly_debug_event [0x000007FEC55053F2+15741826]
    ovly_debug_event [0x000007FEC5518AD3+15821411]
    ovly_debug_event [0x000007FEC5481ADC+15202924]
    ovly_debug_event [0x000007FEC54AC960+15378672]
    ovly_debug_event [0x000007FEC548142A+15201210]
    ChromeMain [0x000007FEC46011BD+293]
    Ordinal0 [0x000000013F712767+10087]
    Ordinal0 [0x000000013F71182D+6189]
    GetHandleVerifier [0x000000013F819092+673122]
    BaseThreadInitThunk [0x0000000076F959CD+13]
    RtlUserThreadStart [0x00000000771CA561+33]

TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md

    at onClose (***\node_modules\puppeteer\lib\Launcher.js:348:14)
    at ChildProcess.<anonymous> (***\node_modules\puppeteer\lib\Launcher.js:338:60)
    at ChildProcess.emit (events.js:215:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)

This works, on the other hand:

puppeteer: {
        headless: true,
        ignoreDefaultArgs: ['--single-process']
    }
pevers commented 4 years ago

Thanks for pointing this out. I introduced this flag as a hotfix because of an issue with Puppeteer not supporting the multi-process. We can probably remove it.

DanHelfman commented 4 years ago

Windows 10 64-bit Node.js 12.16.1

Was the above issue resolved, and if so, where was the ignoreDefaultArgs entry added (i.e., which json file)? I am experiencing a nearly identical error message in trying to run some code on a PC that had originally been written on a Mac:

Failed to launch chrome! [0313/090739.274:FATAL:content_main_runner_impl.cc(526)] --single-process is not supported in chrome multiple dll browser. Backtrace: ovly_debug_event [0x00007FFF873A5E12+15744418] ovly_debug_event [0x00007FFF873A53F2+15741826] ovly_debug_event [0x00007FFF873B8AD3+15821411] ovly_debug_event [0x00007FFF87321ADC+15202924] ovly_debug_event [0x00007FFF8734C960+15378672] ovly_debug_event [0x00007FFF8732142A+15201210] ovly_debug_event [0x00007FFF8734BE1A+15375786] ovly_debug_event [0x00007FFF8734BCF2+15375490] ovly_debug_event [0x00007FFF8734BB28+15375032] ChromeMain [0x00007FFF864A11B6+286] Ordinal0 [0x00007FF6DD812767+10087] Ordinal0 [0x00007FF6DD81182D+6189] GetHandleVerifier [0x00007FF6DD919092+673122] BaseThreadInitThunk [0x00007FF806FE7BD4+20] RtlUserThreadStart [0x00007FF80820CED1+33]

TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md

  at onClose (node_modules/puppeteer/lib/Launcher.js:348:14)
  at ChildProcess.<anonymous> (node_modules/puppeteer/lib/Launcher.js:338:60)
pevers commented 4 years ago

This is fixed in #43 by upgrading Puppeteer.