Creating a standalone web automation tool with Electron

Hey everyone! I’m trying to build an Electron app for web automation. The idea is to have a simple GUI where users can input commands and the app does the rest. I’ve been looking into Phantom and Selenium with Chromedriver, but I’m not sure if they’re the best options.

My main concern is making the app easy to use. I want people to just download and run it without any extra steps. The problem is that Chromedriver and Phantom seem to need separate installation and PATH setup. That’s not ideal for my users.

Does anyone know a way to package everything together? Or maybe there’s a better approach I haven’t thought of? I’m open to all suggestions. Really hoping to make this as user-friendly as possible. Thanks in advance for any help!

Have you considered using Playwright? It’s a relatively new automation library that supports multiple browsers (Chrome, Firefox, and Safari) out of the box. I’ve found it to be more versatile than Puppeteer or Selenium.

The beauty of Playwright is that it can be easily bundled with your Electron app. You can use the @playwright/electron package, which is specifically designed for Electron integration. This approach eliminates the need for separate browser installations or PATH configurations.

In my experience, Playwright’s API is quite intuitive and provides powerful features like auto-waiting and strong selector engines. It also handles modern web features better than some older alternatives.

For packaging, I’d recommend using electron-builder. It can create distributable executables that include all necessary dependencies. This way, your users get a truly standalone application.

Remember to thoroughly test on different platforms to ensure consistent behavior. Web automation can be tricky across different environments.

hey, have u tried using pyautogui? it’s pretty simple and works great for basic web automation. you can package it with your electron app using py2exe or pyinstaller. no need for separate browser installs. just make sure to include good error handling, cuz web stuff can be unpredictable. good luck with ur project!

I’ve been down this road before, and I can tell you from experience that Puppeteer is a fantastic option for what you’re trying to achieve. It’s a Node.js library that provides a high-level API to control Chrome or Chromium over the DevTools Protocol. The best part? It comes bundled with a recent version of Chromium, so you don’t need to worry about separate installations or PATH setups.

When I built a similar tool, I found that Puppeteer integrated seamlessly with Electron. You can package it all together, making it super easy for end-users. They just download and run - no fuss, no muss.

One thing to keep in mind: the bundled Chromium does increase your app size. But in my opinion, the trade-off for ease of use is worth it. Plus, Puppeteer’s API is intuitive and well-documented, which made development a breeze for me.

Just a heads up though, make sure you handle errors gracefully. Web automation can be finicky, and robust error handling will greatly improve the user experience. Good luck with your project!