DEV Community

huzikhan66
huzikhan66

Posted on

Building a Bulk Form Submitter with Playwright: A Step-by-Step Guide

Have you ever needed to submit a contact form on dozens — or hundreds — of websites? I recently faced this problem: 120 websites, and manually filling each form was impossible.

So I built a Node.js script using Playwright that does it automatically. In this article, I'll walk you through how it works, the challenges I ran into, and what I learned.

What is Playwright?

Playwright is a browser automation library developed by Microsoft. It lets you control Chromium, Firefox, and WebKit browsers programmatically. Unlike simple HTTP clients, Playwright runs a real browser, which means it can handle:

  • JavaScript-rendered forms
  • Dynamic content
  • Popups and cookie banners
  • Complex interactions

This makes it perfect for form automation where the page is not just static HTML.

The Problem

I had a list of 120 construction company websites. For each one, I needed to:

  1. Open the contact page
  2. Fill in name, email, and message
  3. Submit the form

Doing this manually would take hours. And I needed to do it repeatedly.

Setup

First, install the dependencies:


bash
npm init -y
npm install playwright axios cheerio xlsx
npx playwright install chromium
Enter fullscreen mode Exit fullscreen mode

Top comments (0)