I’m having a weird issue with my browser automation setup. Every time I try to navigate to a different page, either through my script or by manually clicking links, the browser just goes back to the original starting URL instead of going where I want it to go. This happens even when I’m not running any automation code and just clicking around normally. Here’s what my setup looks like:
This sounds like you might be dealing with some kind of meta refresh or JavaScript redirect happening on the target pages. I’ve encountered similar behavior when websites have automatic redirect loops or when there’s some kind of session management forcing users back to a landing page. Try checking the network tab in your browser’s developer tools to see what’s actually happening during navigation - you might spot redirect responses or scripts that are triggering the behavior. Also worth testing with a completely clean browser profile to rule out any cached data or stored session information that could be causing this. The fact that it happens even during manual clicking suggests it’s not your Playwright code but rather something on the website side or browser state related.
hmm, yeah, it does seem like a redirect issue. maybe try looking into any scripts or extensions that could be influencing the behavior. also, check your cookies or try resetting your browser settings to see if that helps. good luck!
I experienced something very similar with Firefox automation and it turned out to be related to the --disable-web-security flag you’re using. That particular flag can cause unexpected navigation behavior in Firefox, unlike Chrome where it works more predictably. Try removing that argument from your launch options and see if the redirecting stops. Also, Firefox sometimes has issues with certain user agent strings that don’t match its expected format - if you’re using a Chrome user agent with Firefox, that could trigger defensive mechanisms on some sites that force redirects back to safe pages. I’d suggest testing with Firefox’s default user agent first, then gradually adding back your customizations to isolate what’s causing the problem.