When use puppeteer
to scrape a bunch of sites via a for-loop
, whenever a new page is created, the browser would jump to the foreground, which hinders me from doing other things on my computer.
Even I set the following args, it still doesn't work, so how could I keep the browser running quietly without jumping to foreground and interupting me?
I need to run in headful
mode, not headless
mode.
headless: false,
args: [
'--user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36',
'--disable-background-timer-throttling',
'--disable-backgrounding-occluded-windows',
'--disable-renderer-backgrounding',
]