Skip to main content
This guide shows you how to use the Self Healing Tool to automatically update your scraper’s code - adding or removing output fields and resolving broken code - without needing to manually edit the underlying script.

What Is the Self Healing Tool?

The Self Healing Tool is an AI-powered code refactor assistant built into Scraper Studio. When your scraper breaks due to a site structure change, or when you need to add or remove output fields, the tool rewrites the relevant parts of your collector’s code based on a plain-language prompt - so you don’t need to dig into the code manually.

When to use it:

Use the Self Healing Tool when a collector stops returning expected data, or when you need to quickly add/remove fields like price, image, or rating without deep coding knowledge.
  • An active Bright Data account
  • An existing scraper in Scraper Studio (Development mode saved version)
  • Access to the Scraper Studio IDE
1

Open the Self Healing Tool

In your Scraper Studio IDE, locate the Self Healing Tool
self-healing-tool-location.png
Expected result: You should see a text input field, ready to accept your instruction.
refactor-collector.png
2

Describe the Fix or Change You Need

Type your request in plain language into the prompt field. Be specific about what is broken or what you want to add.
Example prompts:
Add 'price' and 'image' fields to the output

The 'price' value is returning 'undefined', please fix  
The 'price' field is returning incorrect data from HTML, switch to using tag_response() to capture '/api/price' instead  
Expected result: The AI processes your prompt and generates a proposed code change, highlighted as a diff in the editor.
You don’t have to stay on the page while the Self Healing Tool processes your request, it can take up to 15 mins. Once the AI refactoring is complete, you’ll receive an email notification so you can come back and review the proposed changes at your convenience.
email.png
3

Review the Proposed Changes

Examine the AI-generated diff in the code template. Verify the changes match your intent before accepting.
  • ✅ Accept - Saves the changes to a draft
  • ❌ Decline - Discards the suggestion; your original code remains unchanged
Expected result: If accepted, the editor reflects the updated code and saves it to the draft
4

Run a Preview

After accepting the changes, run a Preview to validate that the scraper is returning the expected data correctly.
run-a-preview.png
Expected result: Your output file includes the newly added/fixed fields with valid, non-undefined values.
view-download.png
5

Save to Production

Once the Preview confirms the data is correct, save the scraper to Production.
save-to-production.png
If you added/renamed fields, you will be prompted to update the schema. Click Update Schema, then click Save to Production.
update-schema.png
Expected result: The refactored/fixed scraper is live and ready to collect data with the new configuration.

Troubleshooting

ProblemLikely CauseResolution
AI-generated code doesn’t fix the issuePrompt was too vagueRe-prompt with more specific field names or error descriptions
Preview still returns undefined valuesTarget site structure changedInspect the live page and include the expected HTML element hint in your prompt
Changes not reflected after acceptingBrowser cache issueRefresh the IDE and re-check Development mode