I'm looking for the best ways to have a PowerShell script that can automatically open a web browser of my choice and perform tasks on a webpage. I've tried using Selenium with GeckoDriver for Firefox, but it seems outdated and hard to set up. Are there any other options that would work better?
5 Answers
What specific tasks are you hoping to automate with the browser? Maybe that can help focus the suggestions better.
While it's definitely doable with PowerShell, I suggest saving yourself some headaches and trying out Puppeteer instead. A quick Google search will lead you to tons of guides and video tutorials that make it easier to get started. Check it out here: https://pptr.dev/guides/what-is-puppeteer
There's also WebMCP, which is emerging as an alternative. Just keep in mind you'd need to implement an LLM as a middleware layer for it.
You might want to check out Playwright! It's got a command-line interface and allows you to script out what you need quite nicely. Plus, they're putting a lot of focus on integrating with LLMs, but it can work perfectly fine just for browser automation. You can find more info on it here: https://github.com/microsoft/playwright-cli
Have you considered using PSPlaywright? It's a wrapper around Playwright that can do exactly what you're aiming for. It simplifies the process a lot!

Totally agree! Playwright is considered the modern upgrade over Selenium and Puppeteer, and it runs super fast in headless mode.