A landing page CTA audit checks the parts of a page that actually produce leads: the calls to action people click and the forms they fill in. On a site with dozens of service or campaign pages, doing this by hand is slow and inconsistent, and the same mistakes repeat across templates: buttons that say Submit, links that say Learn more, fields with a placeholder but no label, a phone field that opens the wrong keyboard, a form that posts over plain HTTP. This guide lists what to check and why, then gives you a Python script that audits any number of URLs and writes a CSV of issues, plus an optional browser check for whether the main CTA is visible without scrolling.

Landing page CTA audit with Python: fetch pages, parse calls to action and forms, flag weak CTA text, unlabelled fields and insecure forms, then export a CSV report
A landing page CTA audit with Python: fetch, parse calls to action and forms, flag problems and export a report.

From my own work: When I audit lead generation sites, the template-level problems outweigh everything else. One contact form component with unlabelled fields and a button that says Send can sit on forty pages. A script finds all forty in a minute, and one component fix repairs them together.

What a landing page CTA and form audit should check

The checks below are things HTML can tell you reliably. Copy quality and offer strength still need a human; the script clears the mechanical issues so that review time goes to the message.

Check Why it matters Severity
Action-oriented CTA text “Get a free quote” tells people what happens next; “Submit” does not High
Generic link and button text “Learn more” and “Click here” are vague for visitors and screen-reader users Medium
Every field has a label Placeholders disappear while typing and are not reliable accessible names High
Correct input types type="email" and type="tel" show the right keyboard on phones and enable validation Medium
autocomplete on contact fields Browsers can fill name, email and phone in one tap Low
Form method and action GET forms put personal data in URLs and logs; http:// actions send it unencrypted High
Number of visible fields Each extra field adds effort; ask only what you need to respond Medium
One H1, viewport meta, meta description Basic structure for mobile rendering and search snippets Medium
Call or WhatsApp link Many visitors, especially on mobile, prefer to call or message Low

The labelling rules come from the W3C forms tutorial (W3C WAI: labeling controls), and the input type and autocomplete advice matches web.dev’s form guidance (web.dev: sign-up form best practices). For colour contrast and error messages in the same forms, see WCAG 2.2 colour contrast and accessible forms.

The Python landing page audit script

The script uses only the standard library: urllib.request to fetch pages and html.parser to walk the markup, so it runs on any server with Python 3.10 or newer. It tracks open links, buttons, labels and headings to collect their text, records every form with its fields, and then applies the checks:

"""Landing page CTA and form audit using only the Python standard library.

Usage: python lp_audit.py urls.txt > report.csv
"""
from __future__ import annotations

import csv
import re
import sys
import urllib.request
from html.parser import HTMLParser

WEAK_CTA = {"submit", "click here", "send", "go", "learn more", "read more", "more", "here"}
CTA_HINT = re.compile(r"b(get|start|book|buy|order|try|request|download|join|call|contact|quote|demo|sign up|subscribe)b", re.I)
TYPE_FOR = {"email": "email", "phone": "tel", "mobile": "tel", "tel": "tel", "website": "url", "url": "url"}


class Page(HTMLParser):
    def __init__(self) -> None:
        super().__init__(convert_charrefs=True)
        self.title = ""
        self.h1: list[str] = []
        self.meta: dict[str, str] = {}
        self.ctas: list[dict] = []
        self.forms: list[dict] = []
        self.labels_for: set[str] = set()
        self._stack: list[dict] = []   # open a/button/label/h1/title elements
        self._form: dict | None = None

    def handle_starttag(self, tag, attrs):
        a = {k: (v or "") for k, v in attrs}
        if tag == "meta" and a.get("name"):
            self.meta[a["name"].lower()] = a.get("content", "")
        if tag in ("a", "button", "label", "h1", "title"):
            self._stack.append({"tag": tag, "attrs": a, "text": ""})
        if tag == "label" and a.get("for"):
            self.labels_for.add(a["for"])
        if tag == "form":
            self._form = {"action": a.get("action", ""), "method": a.get("method", "get").lower(), "fields": [], "submit": []}
            self.forms.append(self._form)
        if tag in ("input", "select", "textarea") and self._form is not None:
            ftype = a.get("type", "text").lower() if tag == "input" else tag
            if ftype in ("submit", "button", "image"):
                self._form["submit"].append(a.get("value", "") or a.get("alt", ""))
            elif ftype != "hidden":
                inside_label = any(s["tag"] == "label" for s in self._stack)
                self._form["fields"].append({
                    "name": a.get("name", ""), "type": ftype, "id": a.get("id", ""),
                    "required": "required" in a, "autocomplete": a.get("autocomplete", ""),
                    "aria_label": a.get("aria-label", "") or a.get("aria-labelledby", ""),
                    "placeholder": a.get("placeholder", ""), "wrapped": inside_label,
                })

    def handle_data(self, data):
        for s in self._stack:
            s["text"] += data

    def handle_endtag(self, tag):
        if tag == "form":
            self._form = None
        for i in range(len(self._stack) - 1, -1, -1):
            if self._stack[i]["tag"] == tag:
                el = self._stack.pop(i)
                text = " ".join(el["text"].split())
                if tag == "title":
                    self.title = text
                elif tag == "h1":
                    self.h1.append(text)
                elif tag in ("a", "button"):
                    if tag == "button" and self._form is not None:
                        self._form["submit"].append(text)
                    self.ctas.append({"tag": tag, "text": text, "href": el["attrs"].get("href", "")})
                break


def fetch(url: str) -> str:
    req = urllib.request.Request(url, headers={"User-Agent": "lp-audit/1.0"})
    with urllib.request.urlopen(req, timeout=30) as resp:
        return resp.read().decode(resp.headers.get_content_charset() or "utf-8", "replace")


def audit(url: str, html: str) -> list[tuple[str, str, str]]:
    p = Page()
    p.feed(html)
    issues = []
    add = lambda sev, msg: issues.append((url, sev, msg))
    if len(p.h1) != 1:
        add("medium", f"{len(p.h1)} H1 elements (expected 1)")
    if not p.meta.get("viewport"):
        add("high", "No viewport meta tag")
    if not (120 <= len(p.meta.get("description", "")) <= 160):
        add("low", "Meta description missing or outside 120-160 characters")
    action_ctas = [c for c in p.ctas if CTA_HINT.search(c["text"])]
    if not action_ctas:
        add("high", "No action-oriented CTA text found (get, book, start, request...)")
    for c in p.ctas:
        if c["text"].lower().strip(" .!>") in WEAK_CTA:
            add("medium", f"Generic CTA text: '{c['text']}' -> describe the outcome")
        if c["tag"] == "a" and not c["text"] and not c["href"].startswith("#"):
            add("medium", f"Link without text: {c['href'][:60]}")
    if not any(c["href"].startswith(("tel:", "https://wa.me/")) for c in p.ctas):
        add("low", "No tel: or WhatsApp link for visitors who prefer to call")
    for n, f in enumerate(p.forms, 1):
        fields = f["fields"]
        if f["action"].startswith("http://"):
            add("high", f"Form {n} posts to an insecure http:// URL")
        if f["method"] == "get" and any(x["type"] in ("email", "tel", "password") for x in fields):
            add("high", f"Form {n} sends personal data with method=get (ends up in URLs and logs)")
        if len(fields) > 6:
            add("medium", f"Form {n} has {len(fields)} visible fields; check which are really needed")
        for s in f["submit"]:
            if s.lower().strip() in WEAK_CTA:
                add("medium", f"Form {n} submit button says '{s}'")
        for x in fields:
            label = x["wrapped"] or x["aria_label"] or (x["id"] and x["id"] in p.labels_for)
            name = x["name"] or x["id"] or x["type"]
            if not label:
                add("high", f"Form {n} field '{name}' has no label" + (" (placeholder only)" if x["placeholder"] else ""))
            want = next((t for k, t in TYPE_FOR.items() if k in name.lower()), None)
            if want and x["type"] != want:
                add("medium", f"Form {n} field '{name}' is type={x['type']}, use type={want}")
            if x["type"] in ("email", "tel") and not x["autocomplete"]:
                add("low", f"Form {n} field '{name}' has no autocomplete attribute")
    return issues


if __name__ == "__main__":
    writer = csv.writer(sys.stdout)
    writer.writerow(["url", "severity", "issue"])
    for line in open(sys.argv[1], encoding="utf-8"):
        url = line.strip()
        if not url or url.startswith("#"):
            continue
        try:
            writer.writerows(audit(url, fetch(url)))
        except Exception as exc:  # keep going when one URL fails
            writer.writerow([url, "error", str(exc)])

Run the audit and read the report

Put one URL per line in a text file, then run the script and open the CSV in a spreadsheet:

cat > urls.txt <<'EOF'
https://example.com/
https://example.com/services/wordpress-maintenance/
https://example.com/contact/
EOF

python3 lp_audit.py urls.txt > lp-report.csv
column -s, -t < lp-report.csv | head -20

Against a deliberately bad test page with two H1s, a “Learn more” link, a GET form posting to http://, a placeholder-only name field, an email field typed as text and a Submit button, the script reports:

medium  2 H1 elements (expected 1)
high    No viewport meta tag
medium  Generic CTA text: 'Learn more' -> describe the outcome
medium  Generic CTA text: 'Submit' -> describe the outcome
high    Form 1 posts to an insecure http:// URL
high    Form 1 sends personal data with method=get (ends up in URLs and logs)
medium  Form 1 submit button says 'Submit'
high    Form 1 field 'full_name' has no label (placeholder only)
medium  Form 1 field 'email' is type=text, use type=email
high    Form 1 field 'phone' has no label
low     Form 1 field 'phone' has no autocomplete attribute

Sort by severity and group by issue text: an issue that appears on every URL is a template problem, and fixing the shared component clears all of those rows at once.

A few limits of HTML-only parsing are worth knowing. Forms injected by JavaScript, such as embedded third-party form builders inside iframes, do not appear in the fetched HTML. A form without a method attribute defaults to GET, which the script treats correctly as the HTML default (MDN: the form element). The script uses Python’s lenient HTML parser, which copes with most real-world markup (Python: html.parser).

Optional: check that the CTA is above the fold with Playwright

Whether the main call to action is visible without scrolling depends on layout, so it needs a real browser. Playwright for Python can render the page at a phone viewport and measure where the first matching button or link sits:

python3 -m pip install playwright
python3 -m playwright install chromium
import re

from playwright.sync_api import sync_playwright

URL = "https://example.com/services/wordpress-maintenance/"
CTA_TEXT = re.compile(r"b(get|book|start|request|call|quote)b", re.I)

with sync_playwright() as p:
    browser = p.chromium.launch()
    for width, height, label in [(390, 844, "mobile"), (1366, 768, "desktop")]:
        page = browser.new_page(viewport={"width": width, "height": height})
        page.goto(URL, wait_until="networkidle")
        cta = page.locator("a, button").filter(has_text=CTA_TEXT).first
        box = cta.bounding_box() if cta.count() else None
        above = box is not None and box["y"] + box["height"] <= height
        print(f"{label}: CTA above the fold = {above}", f"(top at {box['y']:.0f}px)" if box else "")
        page.close()
    browser.close()

bounding_box() returns the element’s position relative to the main viewport, or None if it is not visible (Playwright: Locator). Run it on your highest-traffic pages; it is slower than the HTML audit, so there is no need to render every URL.

Turning findings into fixes

  • Rewrite CTA text as an outcome: “Get my free audit”, “Book a 20-minute call”, “Request a quote”. Keep it consistent between the hero button and the form’s submit button.
  • Add visible labels and keep placeholders, if at all, for format examples only.
  • Set types and autocomplete: type="email" autocomplete="email", type="tel" autocomplete="tel", autocomplete="name" for the name field (MDN: autocomplete).
  • Use POST over HTTPS for every form that collects personal data, and return a clear confirmation message after submission.
  • Cut fields: move questions you only need later, such as budget ranges or company size, to the follow-up conversation.
<form action="/lead" method="post">
  <label for="name">Your name</label>
  <input id="name" name="name" autocomplete="name" required>

  <label for="email">Work email</label>
  <input id="email" name="email" type="email" autocomplete="email" required>

  <label for="phone">Phone or WhatsApp <span>(optional)</span></label>
  <input id="phone" name="phone" type="tel" autocomplete="tel">

  <button type="submit">Get my free audit</button>
  <p><a href="/privacy/">How we use your details</a></p>
</form>

Mechanical fixes are safe to ship directly. Changes to wording, offers or form length are hypotheses: test them and judge the result with the method in A/B test statistical significance in Python. Make sure form submissions are counted reliably first, ideally server-side as in the Meta Conversions API guide. The broader process around these tests is in the conversion rate optimization guide, and page structure ideas for technical services are in building a technical B2B landing page.

Run the audit on a schedule

Templates change, page builders get updated and marketing teams add new campaign pages. Run the script weekly from cron or CI against the current sitemap’s landing pages and compare the issue count with the previous run; a jump usually means a component change broke something everywhere at once.

# crontab -e  (Mondays 07:00)
0 7 * * 1 cd /opt/lp-audit && python3 lp_audit.py urls.txt > reports/$(date +%F).csv

Landing page CTA audit checklist

  • Every landing page has at least one action-oriented CTA; no Submit, Send or Click here.
  • Every visible form field has a label; placeholders are never the only label.
  • Email, phone and URL fields use the matching input types and autocomplete values.
  • Forms with personal data use POST over HTTPS.
  • Forms ask only for what you need to reply.
  • One H1, a viewport meta tag and a meta description on each page.
  • Main CTA visible without scrolling on mobile for top pages.
  • Audit re-run weekly; wording changes A/B tested.

Want this done on your own server or site?

I am Saizul Amin, a web developer and technical SEO consultant. I set up and harden VPS servers, migrate WordPress sites, fix indexing problems and build automations. See my portfolio or get in touch.

FAQ

What is a landing page CTA audit?

It is a review of the calls to action and lead forms on landing pages: whether CTA text describes a clear next step, whether forms are labelled, use the right input types and ask for only the necessary information, and whether they submit data securely.

Can Python check landing pages for CTA problems?

Yes. With the standard library you can fetch pages, parse links, buttons and forms, and flag generic CTA text, missing labels, wrong input types, missing autocomplete and insecure forms. A browser tool such as Playwright adds layout checks like whether the CTA is above the fold.

What makes a good call to action?

A good CTA describes the outcome the visitor gets, such as Get a free quote or Book a call, uses an active verb, stands out visually and matches what happens after the click. Generic words such as Submit or Learn more usually perform worse and are less accessible.

How many fields should a lead form have?

As few as you need to respond usefully, often a name, an email or phone number and an optional message. Each extra field adds effort, so move questions that can wait to the follow-up conversation and test any change to form length.

Why are placeholder-only form fields a problem?

Placeholder text disappears as soon as someone starts typing, often has low contrast and is not a reliable accessible name for screen readers. A visible label tied to the field with the for attribute solves all three problems.

Sources

NEW BLOGS. REAL STRATEGIES. REAL RESULTS.

Join our community and receive powerful SEO tips, web optimization guides, and growth strategies as soon as they’re published.

Don’t just read blogs — stay ahead of the competition.

We don’t spam! Read our privacy policy for more info.

Share.

Comments are closed.