Re:Web Scraping with Electron
by TicklishTiger on Saturday March 09, 2019 @08:23AM
(#19345997)
Yes, that might work. Maybe an even better approach is to use chromium-chromedriver.
I just got it working like this:
apt install chromium-chromedriver
chromedriver
This seems to create a service that listens on port 9515 for standardized commands to remote control a chromium instance. The commands seem to be specified by the W3C:https://www.w3.org/TR/webdriver/
I got it to open a browser with this curl command:
curl -d '{ "desiredCapabilities": { "caps": { "nativeEvents": false, "browserName": "chrome", "version": "", "platform": "ANY" } } }' http://localhost:9515/session
I have not yet figured out how to send javascript commands though.
I think you've given my weekend some purpose. Lemme see what I can pull together...
[0] https://chromedevtools.github.io/devtools-protocol/