Extract data from HTML with AI into a Google Sheet
How to extract data from HTML with AI into a Google Sheet: install the Chrome extension, click Build with Browser agent, tell the agent what you want, and follow its prompts. A working bot is built and tested in minutes.
Here is how the automation works. To extract data from HTML with AI, without CSS selectors, loop through the URLs in a Google Sheet, take each page's HTML with Get data from bot's current page set to Select HTML, and pass it to an Integrate AI step with a prompt naming the values you want. The model reads the markup and returns the values; Find row in a Google Sheet finds the URL's own row and Write data to a Google Sheet writes them into it from column B, beside the link. Nothing on the page is selected by hand, so the scraper keeps working when the layout changes.
Build the AI extraction from a description
Describe it and click the button: the agent builds and tests the AI scraper in your Chrome extension. You need a ChatGPT or Claude API key; see the ChatGPT integration.
- Open each URL in column A of my sheet
- Ask me which data the AI should extract
- Put the results in that URL's row from column B
You need a Google Sheet with one page URL per row in column A and nothing to its right: the values land in the same row from column B. Leave the sheet alone while the run writes to it.
Build the AI extraction step by step
The steps the agent builds, as the Builder shows them: each step by its name, with the fields to set under it. Add them yourself in this order in the step-by-step builder, or open the agent's result there to adjust it.
- 1.0
Read data from a Google SheetSpreadsheet: your sheetSheet name: the tab with the URLs in column A
- 2.0
Loop through data- repeats for every row in
[google-sheet-data]
- 2.1
Go to pageURL: column A of[google-sheet-data]
- 2.2
Get data from bot's current pageSelect: the outermost element holding what you want, or the custom selectorbody, with the data type Select HTML
- 2.3
Integrate AIAPI key: your keyPrompt: From this HTML, give me the values I asked for as comma-separated values, nothing else. naming the fields you chose, with[scrape-data]inserted
- 2.4
Find row in a Google SheetSpreadsheet: your sheetSheet name: the same tabValues (comma separated): column A of[google-sheet-data]Exact match: on
- 2.5
Write data to a Google SheetSpreadsheet: your sheetSheet name: the same tabDATA:[ai-output]Write options: Add to existing dataStarting cell:B[find-row-google-sheet], the found row from column B
- repeats for every row in
Common questions about extracting data from HTML with AI
Why does the AI return prose or the wrong values?
The prompt leaves the AI room to guess. Tighten the prompt: name each value, give the order, ask for comma-separated values and nothing else. If the HTML is too large, select a smaller element in Get data from bot's current page instead of body.
Why does nothing reach the AI?
The prompt has no page data in it. Check the Integrate AI prompt contains [scrape-data], and that Get data from bot's current page found the element. When a run fails, hand it to the agent and it repairs the step.
Why extract data from HTML rather than the page text?
Markup keeps structure the text loses: which number is the price, which line is the address. For simple pages the visible text is enough and cheaper in tokens; see scrape any website with ChatGPT.
What does extracting data with AI cost compared with selectors?
A little more time and money: each page costs a model call. Use it for pages whose layout varies; for a fixed layout, selectors alone are faster, as in scrape every page in a list of links.
Can I extract data from HTML with AI without code?
Yes. Every step is a no-code step in the Chrome extension; the prompt is written in plain words, and no selector or script is needed.
Can I use Claude instead of ChatGPT to extract the data?
Yes. Integrate AI takes a ChatGPT or a Claude API key; the prompt and the rest of the automation are the same.
Can I run the AI extraction on a schedule?
Yes. Save the automation and set a schedule. Each run works through every URL in the sheet and writes beside it again, so remove the rows already filled, or move First cell on, before the next run.
Where do I get help?
Get in touch with support, or ask in the axiom.ai community.
Related guides
Scrape any website with ChatGPT into a Google Sheet
- Open each link in the Links tab of my sheet
- Use ChatGPT to find the name, email and job title
- Add them to the Data tab
- Delete the link row once it is done
Count eBay search results for every keyword in a Google Sheet
- Open each eBay search URL in column A of my sheet
- Scrape the total number of search results
- Write the total in column B of the same row
Proofread a website with AI and log typos to a Google Sheet
- Open each page link in the Links tab of my sheet
- Scrape the main text of the page
- Ask AI for spelling and grammar mistakes
- Add the URL and the mistakes to the Data tab
- Delete the link row once it is checked