Using CSS selectors to target content
The Content CSS selector field in the project settings lets you tell FireScraper to extract text only from specific parts of each page. This is optional — if you leave it empty, FireScraper processes the full page using whichever extraction mode you selected.
When to use a CSS selector
Use a CSS selector when:
How it works
When you provide a CSS selector, FireScraper uses it to find matching HTML elements on each page. Only the text inside those elements is extracted. Link discovery (for following links during the crawl) still uses the full page, so the selector only affects what text you get in your results — not which pages get crawled.
Syntax
The selector uses standard CSS selector syntax — the same syntax you would use in a browser's document.querySelector(). You can combine multiple selectors with commas.
Examples
Extract only the main article body
article.post-content
Targets <article class="post-content"> elements. Skips navigation, sidebars, comments, and footers.
Extract content from a documentation page, ignoring the sidebar
main .documentation-content
Targets elements with class documentation-content inside a <main> tag.
Extract only product cards from a listing page
.product-card, .product-item
Matches elements with either class. The comma means "or" — both selectors are matched.
Extract headings and paragraphs only
h1, h2, h3, p
Useful when you want the text structure without lists, tables, code blocks, or other elements.
Target content inside a specific container by ID
#main-content
Matches the element with id="main-content".
Extract table data
table.pricing-table td, table.pricing-table th
Gets all cells from a specific table, useful for pricing comparison scrapes.
Tips
document.querySelectorAll('your-selector')) to verify it matches what you expectmain article, .sidebar-content extracts from both regionsWas this article helpful?
