Quick Start Guide¶
Get up and running with Scrapazoid in 5 minutes!
Your First Script¶
- Navigate to the Editor
After logging in, click "Editor" in the navigation bar.
- Write Your Script
Replace the example code with:
async def main(page):
# Navigate to a webpage
debug_log("Navigating to example.com")
await page.goto('https://example.com')
# Wait for page to load
await page.wait_for_load_state('networkidle')
debug_log("Page loaded")
# Get page title
title = await page.title()
print(f'Page title: {title}')
# Take a screenshot
await capture_screenshot("Initial page")
# Extract some data
heading = await page.locator('h1').first.text_content()
debug_log(f"Heading: {heading}")
# Store the data
scrape_data({
'title': title,
'heading': heading,
'url': page.url
})
debug_log("Script complete!")
- Save the Script
Click the "Save" button and give it a name like "My First Script".
💡 Tip: Scrapazoid automatically creates version 1 of your script when you save it. Every time you change the code and save, a new version is created. This lets you track changes and restore previous versions if needed.
- Run the Script
Click the "Run" button and watch the execution!
You'll see real-time updates in the visualization panel on the right: - Screenshots as the browser loads pages - Logs showing navigation, network requests, and your debug messages - Data as it's extracted
Understanding the Output¶
Screenshot Tab¶
You'll see screenshots of the page as it loads. Automatic screenshots are captured on:
- Page load events
- Scroll events
- Manual
capture_screenshot()calls
Logs Tab¶
View detailed execution logs including:
[Script]- Your debug_log() messages[Navigation]- Page navigation events[Network]- HTTP requests/responses[Browser Console]- Browser console messages
Data Tab¶
See the data you extracted with scrape_data() in JSON format.
Common Patterns¶
Clicking Elements¶
# Click a button
button = page.locator('button.submit')
await button.click()
# Click a link
link = page.locator('a:has-text("More info")')
await link.click()
Filling Forms¶
# Fill text input
await page.locator('input[name="email"]').fill('user@example.com')
# Select from dropdown
await page.locator('select[name="country"]').select_option('US')
# Check checkbox
await page.locator('input[type="checkbox"]').check()
Extracting Data¶
# Get text content
title = await page.locator('h1').text_content()
# Get attribute
href = await page.locator('a').get_attribute('href')
# Get multiple elements
items = await page.locator('.product').all()
for item in items:
name = await item.locator('.name').text_content()
price = await item.locator('.price').text_content()
scrape_data({'name': name, 'price': price})
Waiting for Elements¶
# Wait for element to appear
await page.wait_for_selector('.result', timeout=5000)
# Wait for URL to change
await page.wait_for_url('**/success')
# Wait for navigation
async with page.expect_navigation():
await button.click()
Debugging Tips¶
Script Hangs?¶
Add debug_log() calls to track progress:
Element Not Found?¶
Add timeouts and check if element exists:
# Check if element exists
if await page.locator('.optional-element').count() > 0:
text = await page.locator('.optional-element').text_content()
else:
debug_log("Optional element not found")
Need to See the Page?¶
Take screenshots at key points:
await capture_screenshot("Before action")
await button.click()
await capture_screenshot("After action")
Viewing Execution History¶
After running your script:
- Click "History" in the navigation
- See all your past executions with their status (completed, failed, running)
- Click any execution to view:
- Full logs and error messages
- All screenshots captured
- Extracted data in JSON format
- The exact version of code that was run
Working with Versions¶
Want to see what changed in your script over time?
- Open your script in the Editor
- Click "Version History" button
- View all versions with timestamps
- Click "View Code" to see any version
- Click "Restore" to revert to a previous version
This is incredibly useful when: - A script that was working suddenly breaks - You want to experiment with changes safely - You need to see what code produced specific results
Importing Data¶
Want to run the same script with different inputs? Use the Import Data feature!
- Click the "Import Data" button in the editor
- Paste JSON data (e.g., a list of URLs to scrape)
- Click "Import"
- Access the data in your script via the
imported_datavariable
Example:
Import this data:
Use it in your script:
async def main(page):
if imported_data:
for url in imported_data['urls']:
await page.goto(url)
title = await page.title()
scrape_data({'url': url, 'title': title})
See Importing Data for detailed guide and examples.
Next Steps¶
- Writing Scripts - Comprehensive guide
- Available Functions - Function reference
- Importing Data - Parameterize your scripts
- Script Versioning - Track your changes
- Examples - More example scripts
- Debug Logging - Advanced debugging
Need Help?¶
- Check the Examples section
- Review execution logs for error messages
- See Troubleshooting