Optimizing AI Agents for Web Interaction