
Introduction to DataScrap Language
DataScrap Studio’s custom scripting language makes it easy to extract data from any website without learning complex programming languages like Python or JavaScript. In this tutorial, we’ll cover the basics of the DataScrap language and show you how to create your first data extraction script.
Basic Syntax
The DataScrap language has a simple, intuitive syntax designed for non-technical users. Here’s a basic example:
FIND .product-card
EXTRACT name: .product-title, TEXT
EXTRACT price: .product-price, TEXT
EXTRACT image: img, ATTR(src)
This script will:
- Find all elements with the class
product-card
- For each product card, extract the product name from elements with class
product-title
- Extract the price from elements with class
product-price
- Extract the image URL from the
src
attribute of anyimg
tag within the product card
Key Commands
FIND
The FIND
command selects elements from the page using CSS selectors. This is always the first command in your script:
FIND .article
You can use any valid CSS selector with the FIND
command:
FIND #main-content .product-listing li
EXTRACT
The EXTRACT
command gets data from the selected elements:
EXTRACT title: h1, TEXT
EXTRACT description: .description, TEXT
EXTRACT url: a, ATTR(href)
EXTRACT html: .content, HTML
The format is:
EXTRACT [name]: [selector], [type]
Where:
name
is what you want to call this data in your resultsselector
is a CSS selector relative to the elements found by theFIND
commandtype
can be:TEXT
- Gets the text contentHTML
- Gets the HTML contentATTR(attribute_name)
- Gets a specific attribute value
Advanced Example
Here’s a more advanced example that extracts product information from an e-commerce site:
FIND .product-grid .product
EXTRACT name: .product-name, TEXT
EXTRACT price: .price .current, TEXT
EXTRACT originalPrice: .price .original, TEXT
EXTRACT rating: .rating-stars, ATTR(data-rating)
EXTRACT inStock: .stock-status, TEXT
EXTRACT imageUrl: .product-image img, ATTR(src)
EXTRACT productUrl: a.product-link, ATTR(href)
Next Steps
Now that you understand the basics of the DataScrap language, you can start creating your own data extraction scripts. In our next tutorial, we’ll cover more advanced features like pagination, filtering, and data transformation.
Ready to try it yourself? Download DataScrap Studio and start extracting data in minutes!