I’ve been dealing with this for years. You build a solid browser automation that works perfectly, then the site redesigns their login page or changes a selector, and suddenly everything breaks. It’s frustrating because the automation logic itself is fine—it’s just brittle against UI changes.
Recently I started experimenting with something different. Instead of hardcoding selectors and expecting them to stay the same, I switched to using plain language descriptions of what I’m trying to do. Like instead of targeting a specific button by ID, I describe it as “the blue submit button on the login form.” The AI then interprets that and builds the workflow to be more adaptive.
What surprised me is how much more flexible this makes things. When the site updates their UI, the workflow doesn’t completely fall apart because it’s built on intent rather than brittle element targeting. The headless browser still handles the actual interaction, but the logic layer understands context instead of just following exact coordinates.
I found the key was letting the AI generate the workflow from a description first, then looking at what it created. You can usually spot where it’s being too rigid and adjust. The AI can also learn from those adjustments.
Has anyone else moved away from hardcoded selectors and tried a more adaptive approach? I’m curious if others have hit the same breaking points I did.