SHEETSTEPS_SELECTOR: scrape any public element with a CSS selector

Extract text or an allowed attribute from repeated page elements using a CSS selector.

SHEETSTEPS_SELECTOR — SheetSteps
QUICK ANSWER

Put a public URL in A2 and enter =SHEETSTEPS_SELECTOR(A2,".product-price","text",20). SHEETSTEPS_SELECTOR returns matching text or an approved attribute from elements selected by CSS. For a long URL range, open the SheetSteps AI sidebar, preview the same extraction, confirm the destination and run it through the job queue.

SHEETSTEPS_SELECTOR is one of the live SheetSteps AI web functions. Use it when the field has a stable selector and no dedicated SheetSteps function fits it. The fetch runs through SheetSteps-hosted scraping rather than exposing scraping infrastructure inside the spreadsheet.

The function starts with a fast static fetch. When permitted and necessary, SheetSteps can use its browser-rendering fallback for a page whose required content appears after JavaScript runs.

SHEETSTEPS_SELECTOR spreadsheet used in this article
A working sheet built for this article. The numbers are sample data.
HOW IT WORKSFrom URL list to reviewed rows
URLSstore.example/astore.example/bstore.example/c
STATIC FETCHSMART RENDERING
WHEN NEEDED
STRUCTURED OUTPUTTitlePriceStatus3 rows ready
SheetSteps previews the schema, runs the hosted extraction, tracks each row and asks before writing into populated cells.
01
INSTRUCTIONS

SHEETSTEPS_SELECTOR: scrape any public element with a CSS selector

  1. 01
    Add the public URL

    Place one HTTP or HTTPS URL in A2. Private network addresses, unsafe redirects and credentialed URLs are blocked.

  2. 02
    Enter the SheetSteps formula

    Paste =SHEETSTEPS_SELECTOR(A2,".product-price","text",20) into B2 and wait for the bounded result.

  3. 03
    Check the first result

    Prefer stable classes or data attributes. Avoid long selectors tied to decorative page nesting.

  4. 04
    Preview a larger range

    Open Extract in the SheetSteps AI sidebar, select the URL range and inspect sample rows plus the destination.

  5. 05
    Run the batch job

    Submit the confirmed preview, follow row progress in Jobs and retry only failed rows.

  6. 06
    Approve write-back

    Inspect the destination again. SheetSteps does not silently replace populated cells.

02
WEB SCRAPING

Use SHEETSTEPS_SELECTOR in a cell

SHEETSTEPS_SELECTOR returns selector result table. The simple cell workflow is best for a small number of URLs and for checking the exact output before you prepare a larger run.

Keep the source URL visible beside the result. Add a status or reviewed column when another person needs to approve the entry.

fx=SHEETSTEPS_SELECTOR(A2,".product-price","text",20)
03
WEB SCRAPING

Run the same extraction across a range

Select the URL column in the Extract or Batch tab, choose the matching workflow and preview several rows. The preview records the proposed output and destination before a job can enter the queue.

Jobs expose progress, pause, resume, cancellation and row-level retries. Cached requests prevent duplicate work when the same page and extraction are requested again.

  • Preview required
  • Hosted page fetch
  • Static fetch first
  • Browser fallback when needed
  • Retry failed rows
  • Confirmed write-back
04
WEB SCRAPING

Use the function within its boundaries

SheetSteps reads public pages. It does not bypass logins, private pages or access controls, and its URL policy blocks local networks, metadata endpoints and unsafe protocols.

Prefer stable classes or data attributes. Avoid long selectors tied to decorative page nesting.

05
COMMON QUESTIONS

Questions people ask

What does SHEETSTEPS_SELECTOR return?

It returns matching text or an approved attribute from elements selected by CSS.

Can I fill SHEETSTEPS_SELECTOR down a URL column?

Yes for a small range. Use a previewed queued job for a large range so progress, caching and row-level failures remain visible.

Does the formula work on JavaScript pages?

SheetSteps tries a static fetch first and can use hosted browser rendering when the required content is absent and the job permits that fallback.

Will SheetSteps overwrite existing cells?

Not silently. Batch write-back records the destination during preview and requires explicit overwrite confirmation.

READ NEXT

More from SheetSteps