is there any way to create an Ai Agent Web Crawler that can input, select option, press button from a website, for example an motor insurance website that require make-model, vehicle register year etc, after entering the details, it then proceed to the next page by pressing on button
It looks like your topic is missing some important information. Could you provide the following if applicable.
- n8n version:
- Database (default: SQLite):
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app):
- Operating system:
As of now we donāt have many options for that kind of interaction using AI Agents.
That is a fairly complex task, but scrapers use some methods to emulate user interaction.
Here are some of the methods:
-
Headless Browsers
Tools like Selenium, Puppeteer, or Playwright open a browser instance (often in headless mode) to simulate real user actions such as clicks, typing, and form submissions.
Opinion: This is effective because it replicates an actual user environment, handling JavaScript and dynamic content seamlessly. -
JavaScript Event Simulation
Directly triggering DOM events (e.g., usingelement.click()
ordispatchEvent(new Event('click'))
) allows scrapers to emulate interactions without a full browser.
Opinion: This method is useful for lighter interactions when full browser overhead isnāt necessary. -
HTTP Request Simulation
By inspecting the network requests and replicating them using HTTP Request node, you could mimic user actions without rendering a page. -
Using Scripting Libraries in Browser Context
Tools like CasperJS or PhantomJS (though less common now) allow for scripting user interactions within a browser context to handle form fills, clicks, etc.
But you would need a more complex setup than just n8n for this.
The final answer is: you canāt do this easily, but itās possible if you have the tools and knowledge.
If my reply answers your question, please remember to mark it as a solution.
Hello, I also am looking to do the same sort of thing, under the siren call of chatbot-driven E2E testing.
Iāve extended a docker image that was built for puppeteer and added playwright and had terrible time trying to get it to open a browser - so I hit pause on that
Iāve now setup n8n running in npx, having figured out how to install playwright and puppeteer-core with pnpm add -w playwright puppeteer-core
and use the brand new playwright-mcp-server
So my workflow is working nearly correct, except that the stdio coupling seems to be launching a new copy of the playwright mcp server for each usage of the playwright mcp tool executor
So I end up with a dozen instances of the browser
Is it normal for n8n to launch a new instance of each stdioād mcp client each time it is called?
I have the similar issue!I canāt understand why this happens.After I use the navigate tool,I use playwright_get_visible_html tool and it reopen a new brower just showing about:blank.They canāt be linked together!Now I have no solution on it!
How did you get to open up a browser? Whenever i try that i run into another issue, like running into an issue to install chrome, and when i want to do the browser_install execute tool then it needs playwright , but then i extend it with execute shell and install the dependencies still nothing, same issues
if you have any tips and made progress in order for the playwright mcp to work some help would be much appreciated!
Hi @davidl33, @E_P, and others,
I know Iām quite late to the party, but I had the same issue and really just wished for a āPlaywright MCP Server in the cloudā so that my AI Agent can simply browse the Web and I donāt need to fiddle with any infrastructure.
Consequently, I fiddled with infrastructure a lot for a couple of days and built https://playwright-mcp.develop-build-deploy.com, which letās you spin up your personal hosted Playwright MCP Server with Bearer Auth, and it works just beautifully with n8n (see the demo video on the homepage).
Just drop the MCP Server URL into the AI Agent and set up the Bearer Auth credentials, and you are good to go.
You can even watch what exactly the AI is doing in the browser, as it comes with an embedded browser-based VNC viewer.
This is freaking magic @ManuelKiessling . Thank you! You just solved a problem Iāve been struggling with for hours in one shot. Works brilliantly!
My only suggestion is to add a bit more granular steps in your how-to and link back to them from within the UI. A little how-to on n8n specifically would be extra nice, but I figured it out pretty quickly regardless.
My biggest concern now, with this service, is if it will ever go away!? I can see myself using this for a lot of things and donāt want the headache when/if it ever disappeared.
Hey @nateritter, thank you so much for your message, this really made my day!
I can understand your concern, and yes, the unpolished nature of the product in this early stage might come across as it being not really serious, but quite the opposite!
First and foremost, I cannot disable it simply because at my company, we are already running some mission-critical n8n stuff on top of it.
But most importantly, Iām very serious in growing this into a full-fledged SaaS offering, and as simple as it might appear on the surface, the underlying code and infrastructure is extremely solid and sophisticated (I can give you a tour if you are interested).
But here is a deal: drop me a line at [email protected] ā should this project ever go the way of the dodo, then Iāll set up a hosted Playwright MCP instance on a server of your choice, as a promise to not leave you out in the cold!
And furthermore thank you so much for your feedback on usability; I will start building a more guided approach right away.
Thatās fantastic news. And yes, Iāll be emailing you, and yes, Iād love a tour. I donāt judge a back-end by itās front-end at all. I just know my own personal projects, if they arenāt used by others, one day when I donāt use them itāll die a popperās death unceremoniously.
Thank you for being open to the thoughts proposed, and for being available to talk shop about keeping it up, however that might happen. Very cool of you.
See you in the emails soon.
Hi Manuel - I saw this and tried using. but for some reason the browser is not launching. Any chance you can help? localhost installation, everything runs, apart from display the actual headless browse. Seems that even the navigation happens in the background
Any help would be much appreciated.
Thanks
K
Hi Kacper,
I will try my best to help. Iām not sure if I understand the problem already, though.
How do you call your MCP instance? Via Cursor, N8N AI Agent, something else?
The browser only launches once you trigger the MCP server; until then, the screen in the VNC viewer remains blank.