Browser Agents: Fill a Web Form with Playwright
A browser script tied to one page's ids can break the day the page changes. On my two test pages, a loop that looks first did not.
Video #33 ยท AI agents and MCP
Steps in the video
Files
- agent.py (76 lines)
- compare.py (47 lines)
- shopsite.py (57 lines)
Tested with
Python 3.12.15 | playwright==1.64.1
What this does not show
Two versions of a made-up form that I wrote, served on this computer. The step that decides is plain code with rules that match my labels; no language model is used, so prompt injection, logins, captchas and real sites are not tested.
Sources
Learning IT by Example.