Skip to content

Quick Start Guide

Get up and running with Scrapazoid in 5 minutes!

Your First Script

  1. Navigate to the Editor

After logging in, click "Editor" in the navigation bar.

  1. 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!")
  1. 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.

  1. 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:

debug_log("About to click button")
await button.click()
debug_log("Button clicked successfully")

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:

  1. Click "History" in the navigation
  2. See all your past executions with their status (completed, failed, running)
  3. Click any execution to view:
  4. Full logs and error messages
  5. All screenshots captured
  6. Extracted data in JSON format
  7. The exact version of code that was run

Working with Versions

Want to see what changed in your script over time?

  1. Open your script in the Editor
  2. Click "Version History" button
  3. View all versions with timestamps
  4. Click "View Code" to see any version
  5. 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!

  1. Click the "Import Data" button in the editor
  2. Paste JSON data (e.g., a list of URLs to scrape)
  3. Click "Import"
  4. Access the data in your script via the imported_data variable

Example:

Import this data:

{
  "urls": ["https://example.com", "https://www.iana.org/domains/reserved"]
}

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

Need Help?