How to Create a Web Scraper with AI: AIScript User Guide

This guide shows how to build a web scraper in AIScript, the MyDataProvider AI web scraping tool, from the first task to a scheduled data feed. It covers how to write a task the AI understands on the first try, what happens during a build, how to read results, how to change a scraper later, and how to work with logins, files, price formulas and specific categories.

Contents

  1. Quick start: your first scraper in 5 minutes
  2. How to write a good task
  3. What happens during a build
  4. Running the script and reading results
  5. Changing a scraper with AI
  6. Change history and restoring versions
  7. Files for the AI: docs, samples, URL lists
  8. Secrets: logins, passwords and API tokens
  9. Scraping only specific categories or products
  10. Price rules and markup formulas
  11. Exporting only new or changed items
  12. Limits and troubleshooting

Quick Start: Your First Scraper in 5 Minutes

  1. Sign up at script.mydataprovider.com with your email and confirm it. The 30-day trial needs no card.
  2. Create a task. On the My tasks page press + New task, or start from one of the ready examples (website catalog parser, API export to Excel, price monitoring).
  3. Describe what you need in the Describe the task for the AI agent box and press Start generating the script.
  4. Confirm the plan the agent shows you, or add a correction.
  5. Wait for the build. A simple feed or page takes about a minute, a catalog with detail pages about 5 to 10 minutes. When it is done, the result table and download links appear under Run script.
My tasks page in AIScript with ready examples for a website catalog parser, API export to Excel and price monitoring
The task list. Each task holds one scraper with its runs, schedule and API keys.

How to Write a Good Task

The agent is good at figuring out how to get data. What it cannot guess is what exactly you want. A good task answers four questions:

QuestionWrite it like this
Where?The full start URL: a category, search results with your filters, a sitemap, an API endpoint. If there are several, list them or attach a file.
Which records?"All products in all subcategories", "only the first 3 pages", "only items in stock", "every listing posted in the last 7 days".
Which fields?Name the columns in the order you want: "SKU, name, brand, price, old price, stock, category path, image URLs, product URL".
What output?File name and format, separators and number format: "result.xlsx", "CSV with ; separator for European Excel", "JSON array, prices as numbers".

Example of a complete task:

Scrape all products from https://example-shop.com/tools/ including subcategories.
For each product open its page and collect: SKU, name, brand, price (number),
old price if there is a sale, stock status, category path, all image URLs, URL.
One row per variant (size/color), with the variant SKU and price.
Save as result.xlsx with a header row, and also result.csv (UTF-8, comma).

More tips:

What Happens During a Build

After you press Start generating the script the agent first shows how it understood the task: the steps, the fields, the output files and its assumptions. If something is off, type a correction ("the price must include VAT", "skip the outlet category") or press Looks right, go ahead.

AIScript confirmation dialog: the AI agent lists how it understood the scraping task
The confirmation step catches misunderstandings before any code is written.

Then the agent works in a loop: it inspects the site, writes the script, runs it in the sandbox, looks at the output and fixes problems. The status line shows the current step (Writing code, Analyzing the run result) and the live output of the test run. Details shows how the AI reasoned and what it ran. You can leave the page; the build continues on the server.

AIScript message: the web scraper script is ready and verified, with Run script and Schedule buttons
A finished build: the script is verified and runs automatically a minute later if you do nothing.

When the build is finished, the script is saved with the task and the result of its last run appears below. If the agent cannot reach a reliable result (the site blocks all requests, the data is not on the page), it says so instead of returning an empty file.

Running the Script and Reading Results

Run script starts the saved scraper again, without the AI. This is what you use for every update, and it is what the scheduler and the API do too. Runs do not use your monthly AI builds.

Script run log in AIScript: progress lines, execution time, peak memory and created files
The run window: live log, execution summary and the files the run created.
Preview of a scraped CSV file in AIScript: rows, columns and download link
Preview of result.csv from the books scraper: 1,000 rows, 8 columns.
Run history of a web scraping task in AIScript with Log, download and Preview links for CSV, JSON and XLSX files
Run history: one run of the books scraper wrote three files, each with a download and a preview link.

On the free tier and during the trial the preview and downloads include the first 50 rows; the paid plan unlocks the full files. See pricing.

Changing a Scraper with AI

To change a working scraper, open Change the script under the run history and write what should be different, as an instruction to the existing script. Earlier requests are listed above the box, so you see how the scraper evolved:

The agent loads the current script, makes the change, tests it and saves it as a new version. Small changes are faster and more reliable than writing the whole task again.

Developers can get access to the Python code itself: write to us and we enable the code editor for your account.

Change History and Restoring Versions

Change history keeps every version of the script: who made it (AI build, AI edit or a manual change), when, and the request text that produced it. If a change made things worse, open the history and restore the previous version with one click. The restored version becomes the active one for manual runs, the schedule and the API.

Files for the AI: Docs, Samples, URL Lists

The Files button opens the task's files. Anything you upload there is available to the agent while it builds the script and to the script on every run. Typical uses:

Files dialog in AIScript for uploading API docs, data samples and URL lists for the AI
The Files dialog: upload docs, samples or input lists for the agent.

The more context, the more accurate the result. Replacing a file (for example a new URL list) changes what the next run processes without any AI edit.

Secrets: Logins, Passwords and API Tokens

If the data is behind a login or an API key, add it in Script secrets instead of the task text. Give each secret a clear name, such as SUPPLIER_LOGIN, SUPPLIER_PASSWORD or SHOP_API_TOKEN, and mention in the task that the site needs a login. The agent wires the secrets into the script.

Script secrets in AIScript: encrypted supplier login, password and store API token, values masked
Script secrets: values are masked and stored encrypted.

When a password changes, update the secret; the script picks it up on the next run.

Scraping Only Specific Categories or Products

You do not need a special filter screen: the scope is part of the task. Common ways to define it:

Mixing them is fine: whole categories plus a few extra product URLs from a file.

Price Rules and Markup Formulas

Scrapers for resellers usually need a retail price, not the supplier price. Describe the rule in the task and the script adds the calculated column to every export. The classic formula is:

new price = supplier price × (1 + margin % / 100) + fixed amount

For example, with a 10% margin a 100 USD product becomes 110 USD; with a 10% margin plus 2 USD it becomes 112 USD. Rules you can ask for:

RuleHow to write it in the task
Fixed margin"Add retail_price = price × 1.30"
Margin by category"Use margins from margins.xlsx: column A category, column B margin %"
Margin by price range"Up to 20: +60%, 20 to 100: +35%, over 100: +20%"
Currency conversion"Convert EUR to USD with the rate from the ECB daily XML"
Pretty prices"Round up to .99" or "round to the nearest 0.05"
Category remapping"Replace source categories with mine from category_map.csv"

Keep the original supplier price as its own column so you can always check the calculation. To push the result into a shop, see products import.

Exporting Only New or Changed Items

A script can keep files between runs. Ask for it in the task: "remember the products from the previous run and export only new products and price changes to changes.csv". The script stores its state with the task and compares each run with the previous one. This is useful for new-arrival alerts, price change reports and faster daily updates of big catalogs.

Limits and Troubleshooting

ItemValue
AI builds and edits20 per month on the paid plan, 2 on the trial
Manual, scheduled and API runsDo not use AI builds
Maximum run timeAbout 5 hours per run
Rows in preview and downloadsFirst 50 rows on free and trial, full files on the paid plan

The result is empty or has fewer rows than expected. Open the log of the run. Often the site showed a captcha, a cookie wall or a region selector. Tell the agent what you see on the site ("the page asks to choose a country first") in an edit.

A scheduled run started failing. The site probably changed. Write "the last run failed, fix the script"; the agent reads the log of the failed run.

The site blocks requests. The agent slows down, uses a real browser or the site's own JSON API. Some marketplaces and heavily protected sites need our infrastructure: ask for a custom scraper.

Still stuck? Use contact and include the task name; we can look at the run log with you.

AI

Have a scraping or integration task? Let our AI solve it.

Describe what data you need or which systems to connect — our AI builds and runs the scraper or integration for you. No coding required.

Free for 14 days, no card needed · already have an account?

Frequently Asked Questions

How do I create a web scraper without coding?

Create a task in AIScript, describe the start URL, the records, the fields and the output format in plain English, confirm the plan the agent shows, and wait for the build. The agent writes, runs and tests the scraper and returns the file.

How long does it take to build a scraper?

From under a minute for a single page or feed to about 5 to 10 minutes for a catalog with detail pages. Big sites with logins, detail pages or JavaScript take longer because the agent tests more cases. After that, each run takes as long as the site needs to be crawled.

Can I scrape only some categories of a site?

Yes. List the category URLs in the task, paste a URL with the site's own filters, or upload a file with product URLs or SKUs to process.

Can the scraper calculate my retail prices?

Yes. Describe the rule, such as a margin percent, a margin by category or price range, currency conversion and rounding to .99. The script adds the calculated column to every export.

Where do I put the password for a supplier site?

In Script secrets of the task. Values are encrypted, given to the script as environment variables only at run time and masked in logs.

Can I see and edit the Python code?

By default you change the scraper in words and the AI edits the code. For developers we can enable the code editor on request.