Back to ZenRows in Excel
SheetXAI logo
ZenRows logo
ZenRows · Excel Guide

Extract Targeted Data From Web Pages Using CSS Selectors in a Excel

2026-05-14
5 min read

The Scenario

You are three days into a sourcing project. Eighty job listing URLs are in column A — pulled from a mix of company career pages and aggregator listings. Column B holds CSS selectors your team wrote for each site's structure: h1.job-title, .salary-range, span.location. Column C is empty.

The column C header says "Job Title." The job is to fill it.

The bad version:

  • Open URL 1, open browser DevTools, find the element matching the selector in B2, copy the text content, paste into C2
  • Repeat for URL 2, but the selector that worked on the first site returns nothing on this one because the HTML structure is slightly different
  • By URL 20 you are maintaining a mental map of which selectors work on which domains, and that mental map is already wrong in at least two places

The selector list exists. The data exists. The gap between them is just mechanical repetition, and you are the one filling it by hand.

The Easy Way: One Prompt in SheetXAI

SheetXAI is an AI agent that lives inside your Excel workbook. It sees column A as URLs, column B as CSS selectors, and column C as the output target. Through its built-in ZenRows integration it can fire the selector-based scrape against each URL and write the matched text into column C in one pass.

Use ZenRows CSS selector scraping on each URL in column A — apply the selector in column B to extract the target element and write the scraped text into column C in Excel

What You Get

  • Column C: the text content of the matched element for each URL
  • Rows where the selector returns no match get a "not found" note rather than a blank, so you know the difference between an empty result and a failed match
  • Rows where ZenRows cannot reach the page get an error note so the gap is visible

What If the Data Is Not Quite Ready

The selector in column B only sometimes matches — some pages use a different class name

For each URL in column A, try the primary selector from column B — if it returns no match, fall back to the selector in column D and write the result into column C, noting which selector was used in column E

You want to extract two elements per URL — job title and salary — into separate columns

For each URL in column A, use ZenRows CSS selector scraping to extract the element matching column B into column C, and the element matching column D into column E

Some URLs are behind JavaScript rendering and returning empty content with basic scraping

For each URL in column A, use ZenRows with JavaScript rendering enabled and the selector in column B — write the matched element text into column C

Clean up results before writing — strip whitespace, remove salary currency symbols, standardize location strings

For each URL in column A, scrape with ZenRows using the selector in column B, then clean the extracted text by trimming whitespace and removing any dollar or pound signs, and write the normalized result into column C — flag any result that still contains unusual characters in column D

One shot handles the scraping, the selector logic, and the normalization.

Try It

Get the 7-day free trial of SheetXAI and open an Excel workbook with a URL column and a CSS selector column. Ask it to fill your output column with the matched elements. For broader structured extraction without selectors, see the auto-parse spoke on bulk URL scraping.

Stop memorizing formulas.
Tell your spreadsheet what to do.

Join 4,000+ professionals saving hours every week with SheetXAI.

Learn more