CSS & XPath Extractor: Custom HTML Rules
Extract with CSS, XPath, or safe regex on up to 10 URLs. Match table and CSV. Raw HTML, no JS. Not a fixed H1/H2 tool — custom rules only.
- Open the tool
- Enter your URL or data
- Review your results
- Browser-based — no install
- Instant results
Paste up to 10 URLs and up to 10 rules (CSS, XPath, or safe regex). Match table with url, rule, type, index, value, and attribute, plus CSV. Raw HTML only — use the H1/H2 Extractor for fixed headings across more URLs.
By Faisal YUpdated
Template audits rarely fail on headings alone. They fail on the boring fields buried in HTML: a canonical pointing at staging, a meta robots left on by mistake, a product ID in a data-* attribute, or JSON-LD that still references the old brand name. View Source on ten URLs is workable. On thirty template variants after a CMS deploy, it is not. The CSS & XPath Extractor on Scrawl fetches up to 10 URLs and runs up to 10 rules you define: CSS (cheerio), XPath (cheerio to well-formed XHTML, then a safe evaluator with limits), or regex with the same guards as Source Code Search . Output is a match table plus CSV. Raw HTML only. No JavaScript rendering. ! Flow from URL list through CSS and XPath rules to a results table When custom rules beat fixed heading tools Use the H1/H2 Extractor when the question is strictly heading hierarchy across up to 100 URLs. It is faster and opinionated for that job. Use custom CSS or XPath when: You need canonical URLs ( link[rel=canonical] or //link[@rel='canonical']/@href ) You are sampling meta robots or description tags across a launch batch You want one CSS class of links, not every anchor ( Link Extractor is the full inventory tool) You are hunting a string pattern in HTML with safe regex After you locate JSON-LD script blocks, validate them with the Schema Checker . Extraction finds the block; schema validation checks whether it parses. CSS selectors: start here CSS is the fastest path for most SEO fields: | Goal | Example rule | Attribute column | |------|----------------|------------------| | Canonical href | link[rel='canonical'] | href | | Meta description | meta[name='description'] | content | | OG title | meta[property='og:title'] | content | | JSON-LD body | script[type='application/ld+json'] | leave empty (text) |…
Read the full guideWhat this extractor does
Fetches each URL you list and runs **your** extraction rules against the **raw HTML response**. Rule types:
- **CSS** — cheerio selectors (for example `meta[name="description"]`, `a.cta`, `script[type="application/ld+json"]`) - **XPath** — messy HTML is normalized with cheerio, then expressions run in a worker with node caps and a hard timeout (invalid syntax returns a clear error) - **Regex** — same safe-regex validation as [Source Code Search](/tools/source-code-search) (200 character cap, nested quantifiers rejected)
Each match row shows the URL, rule, type, match index, extracted value, and optional attribute name. Export CSV for spreadsheets.
JavaScript is **not** executed. Content that only exists after client render will not appear unless it is in the initial HTML.
How this differs from the H1/H2 Extractor
The [H1/H2 Extractor](/tools/h1-h2-extractor) is purpose-built for **heading tags only** across up to 100 URLs. This tool is for **custom** selectors — canonical hrefs, product SKUs in data attributes, JSON-LD script bodies, or any pattern you define. Use the heading extractor for fast H1/H2 audits; use this tool when your rule is not limited to `h1` and `h2`.
When to use it
- Pull `rel=canonical` or `meta robots` values across a template batch - Extract `href` from a specific CSS class without exporting every link ([Link Extractor](/tools/link-extractor) is better for full anchor inventories) - XPath for attributes when CSS is awkward (`//link[@rel='canonical']/@href`) - Regex for leftover analytics IDs in HTML
Pair structured-data checks with the [Schema Checker](/tools/schema-checker) after you locate JSON-LD blocks.
Limits
Up to 10 URLs and 10 rules per run. HTML capped at 1.5MB per page. Match and value length caps apply. XPath and regex have additional safety limits. Rate limits apply per URL fetch; private and localhost targets are blocked.
Frequently Asked Questions
Does this tool render JavaScript?
No. Only the initial HTML from the server is parsed. Client-rendered content is out of scope unless you paste HTML that already includes it.
How is this different from the H1/H2 Extractor?
The H1/H2 Extractor pulls fixed heading tags across up to 100 URLs. This tool runs custom CSS, XPath, or regex rules you define on up to 10 URLs.
How many URLs and rules can I use?
Up to 10 URLs and 10 rules per run. Each rule runs against every URL in the list.
Is XPath safe?
Expressions are length-capped. Evaluation runs in a worker thread with a hard timeout (about 2.5 seconds) and node caps before matches are collected. Invalid XPath returns an error. The tool never uses eval.
Can I export results?
Yes. Download CSV with url, rule, type, index, value, and attribute columns. Formula-like cell values are escaped for spreadsheet safety.
Related tools
H1/H2 Extractor
On-Page SEOScrape and analyze heading structures to evaluate content hierarchy and optimiza…
Schema Checker
Technical SEOValidate structured data markup against schema.org guidelines to secure rich sni…
Link Extractor — Full Link Inventory (CSV)
Crawl & AuditFull page link inventory: export up to 500 anchors with external URLs, rel flags…
Source Code Search: Find Text in Page HTML
Crawl & AuditSearch raw HTML on up to 25 URLs for plain text or safe regex. Match counts, sni…