Hacker News new | ask | show | jobs
by ctphipps 3359 days ago
Any way of scripting this to automate button clicks etc? I use PhantomJS for this now but found it to be incredibly unstable for complex pages.
5 comments

Yes: https://github.com/cyrus-and/chrome-remote-interface/wiki/Tr...

But ultimately selenium and webdriver.io will do a better job at this

If you're using Go, you might want to check out https://github.com/knq/chromedp ... There is also a similar package for NodeJS. Otherwise, you can use Selenium in other languages.
There is an excellent library called nightmare (based on electron). If you need print-screens you can use xvfb

or wait for this issue: https://github.com/segmentio/nightmare/issues/224

it should be noted that nightmare isn't safe for untrusted websites: https://github.com/segmentio/nightmare/issues/1060
For complex pages, there is Kantu, which is based on Chromium: https://www.a9t9.com/kantu/web-automation

Not headless, but ideally suited for automating complex websites (date controls, etc).

You can use ChromeDriver, the same as you would for headed Chrome.