Web Scraping
Scrape data from a website and save to Excel file
Steps
| # | Activity | What it does |
|---|---|---|
| 1 | StartWebBrowser | Open target website |
| 2 | GetHtmlElements | Extract elements using selector |
| 3 | CreateTable | Create an in-memory table for the scraped rows |
| 4 | ForEachLoop | Iterate scraped elements and push each row |
| 5 | TableUpsertRow | Append each scraped row to the table |
| 6 | TableExport | Export the collected rows to Excel |
Workflow
StartWebBrowser("https://example.com/products", "useCurrentBrowserSession")
products = GetHtmlElements("//div[@class='product']")
CreateTable("scrapedProducts", schema={"columns": [{"name": "name"}, {"name": "price"}]})
for product in products:
TableUpsertRow("scrapedProducts", {"name": "{{ product.name }}", "price": "{{ product.price }}"}, append=True)
TableExport("scrapedProducts", "./products.xlsx", format="xlsx", sheetName="Products")