Skip to content
On this page

Selector shell

An interactive REPL for testing CSS and XPath expressions against a live page — no code editing or re-running the full generator needed. Ideal for nailing down a selector the heuristics got wrong.

bash
php artisan datahelm:scrap:shell https://www.exampleauctions.com/real-estate/apartments

Once the page is loaded, type commands at the datahelm> prompt:

CommandDescription
css <selector>Run a CSS selector; shows match count + first 5 text values
xpath <expression>Run an XPath expression
attr <selector> <attr>Extract an attribute from all matches (e.g. attr a href)
html <selector>Show raw outer-HTML of the first match
linksList all unique <a href> on the page
imagesList all unique <img src> on the page
infoShow page title and byte count
help / ?Print help
quit / exitLeave the shell

Add --timeout=N or --user-agent="..." for custom HTTP options.

Typical loop

  1. Load the page in the shell.
  2. Try css article.product_pod to confirm the item selector matches the right count.
  3. Use attr h3 a href to verify the link field extracts correctly.
  4. Copy the working selectors into your blueprint's fields[].

This is the fastest way to iterate on selectors without re-fetching the page on every attempt.


Next: HTTP transports & bot protection →

Released under the MIT License.