Ai Agent Web Crawler that can input, select option, press button etc

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:

  1. 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.

  2. JavaScript Event Simulation
    Directly triggering DOM events (e.g., using element.click() or dispatchEvent(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.

  3. HTTP Request Simulation
    By inspecting the network requests and replicating them using HTTP Request node, you could mimic user actions without rendering a page.

  4. 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?

2 Likes

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!

1 Like

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 :smiley: , 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.

1 Like

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. :slight_smile:

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.