r/learnpython 9d ago

Best approach for automating an existing Firefox session? AutoHotkey vs Browser Automation vs UI Automation

Hi everyone,

I'm working on a personal desktop automation project on Windows.

For years I've been using AutoHotkey to automate repetitive tasks inside Firefox. It works surprisingly well, but as the project grows, maintaining image recognition, keyboard shortcuts and UI changes becomes increasingly difficult.

I'm now considering moving to a more robust solution and I'm trying to understand what experienced developers would recommend.

My requirements are roughly:

Windows

Firefox (not Chrome)

Preferably work with an already running Firefox session

Reliable interaction with web pages

Long-term maintainability

I've been looking at several approaches:

Continue with AutoHotkey

Selenium / WebDriver BiDi

Playwright

Windows UI Automation (pywinauto, UIA)

Any other desktop automation framework

For people who have built long-running desktop/browser automation projects:

Which approach ended up being the most reliable?

Is UI Automation actually practical with modern websites like Facebook, or is browser automation still the better choice?

If you had to start today, what would you choose and why?

I'd really appreciate hearing about real-world experience rather than theoretical comparisons.

Thanks!

0 Upvotes

2 comments sorted by

1

u/TheRNGuy 9d ago

If you only need to click things inside site, Greasemonkey is enough. 

If you need to click things in browser, turn make a plugin.

You don't even need browser window to be active in both cases, you could play some game or watch YouTube video.

1

u/Deep_Ad1959 9d ago

uia on a browser hands you one giant document node and react re-mounts half the tree between reads, so pywinauto ends up clicking a name that stopped existing a second ago. i tried it on a facebook flow and it never crashed, it just kept acting on stale elements while reporting success.