Re:Web Scraping with Electron
by TicklishTiger on Saturday March 09, 2019 @08:25AM
(#19345999)
How do you send dev console commands to that port?
It uses the devtools protocol, see here https://chromedevtools.github.io/devtools-protocol/
Looks like it's a REST protocol.
You have to connect to a tab and then call e.g.
Runtime.evaluate {expression: "console.log('test')"}Also, you can apparently connect the puppeteer client to a running chrome instance [1]. That way you can use the nice and statically typed puppeteer api and you should have pretty much zero overhead.
You can also just start chromium with debugging active `--remote-debugging-port=9222` and then connect to that port and send any dev console commands.