r/WebDataDiggers • • 8h ago

Web scraping with Power Automate Desktop without writing code

2 Upvotes

If you run Windows 11, Microsoft already put a web scraper on your computer. Power Automate for desktop, usually called Power Automate Desktop, is a robotic process automation app that records and replays browser actions. People mostly know it for moving files around or typing into old accounting software, though its browser tools are surprisingly capable for pulling structured data off websites.

You would reach for it when simpler options hit a wall. Tools like Excel's Power Query or standard cloud HTTP requests work well on static pages and open feeds, yet they miss content loaded dynamically by JavaScript after a page opens. Power Automate Desktop opens an actual browser, waits for scripts to finish rendering, clicks through menus if needed, and reads what ends up on screen.

Setting up your browser before grabbing any data

Power Automate Desktop supports Microsoft Edge, Google Chrome, Mozilla Firefox, and legacy Internet Explorer. It also includes a built-in Automation browser, though Microsoft plans to remove that option in a future release. Sticking with Edge or Chrome is the safer bet.

Before any flow can read a page, the desktop app needs a bridge into the browser. You have two ways to set that up: installing the official Microsoft Power Automate browser extension (which uses Chrome and Edge's Manifest V3 standard) or placing a matching WebDriver file into your local AppData folder. The extension route is easier for most setups because it lets your flow attach to tabs you already have open, whereas WebDriver can only control browser windows that the flow launched itself.

Once connected, every web scraper starts with a launch action such as "Launch new Microsoft Edge" and stores that window in a browser instance variable. One nice perk of these browser actions is that they talk to the page under the hood rather than hijacking your physical cursor, so the scraper can keep working while the browser sits minimized or behind another window.

Point-and-click extraction with the live web helper

The core of web scraping in Power Automate Desktop is a single action called Extract data from web page. Dragging it onto your flow brings the target browser to the front and opens a small floating window known as the Live web helper.

Instead of inspecting raw HTML right away, you teach the helper by clicking examples. Say you are looking at a directory of suppliers. You right-click the first company name to extract its text, then do the same on the second company name. Power Automate Desktop spots the repeating pattern in the page structure and highlights every matching company name down the page. When you add a second column - like a price or city - clicking just one cell is usually enough for the helper to populate the rest of that column automatically.

If the page already uses a clean HTML table, you can right-click anywhere inside it and pick "Extract entire HTML table" to pull every row and column in one move. You are not stuck with visible text either. Inside the extraction menu, you can tell the helper to pull underlying HTML attributes like href for destination URLs or src for image paths. Everything lands in a structured DataTable variable inside your flow, which you can then dump straight into a spreadsheet using the "Write to Excel worksheet" action.

Scraping multiple pages and clicking into subpages

Real data rarely fits on page one. When results span across numbered pages, you scroll to the bottom while the Live web helper is open, right-click the "Next" button, and choose Set element as pager. Back in the action settings, you decide whether to pull from every available page or stop after a set number. Capping the page count during testing saves a lot of frustration when a site has thousands of pages or a loop refuses to exit.

Things get slightly trickier when a search page only shows summaries and you have to click into each listing to grab phone numbers or descriptions. Power Automate Desktop handles this with a loop tied to the scraped list. After extracting the list of titles and links, the resulting DataTable exposes a row count property (%DataFromWebPage.RowsCount%). You set up a loop counting from 0 to %DataFromWebPage.RowsCount - 1%, place a "Click link on web page" action inside, and modify the link's selector in the text editor so its fixed row index changes from :eq(0) to :eq(%LoopIndex%). On each pass, the flow clicks the next item, scrapes the detail page, and jumps back to the list.

Keeping selectors alive when websites change

Point-and-click recording gets a flow running in ten minutes, though auto-generated selectors can be fragile. Modern sites frequently assign randomized id attributes or messy wrapper tags that shift every time the page reloads. When a flow suddenly throws a "CSS selector wasn't found" error a week later, the culprit is usually an over-specific selector that latched onto a temporary ID.

A few small adjustments keep scrapers running reliably over time:

  • Open your browser's developer tools with F12 to inspect the actual HTML and write shorter CSS selectors based on stable class names or attributes rather than relying on long auto-captured paths.
  • Leave the "Process data upon extraction" option switched off if you are pulling large tables, since built-in whitespace cleanup slows down big extractions. Clean the text afterward with regular expressions or a "Parse text" action instead.
  • Turn off the "Unfocus text box after filling it" toggle when building search scrapers that press Enter after typing a query, as leaving it on often causes the Enter keystroke to miss the search box.
  • Reset your output DataTable variable inside outer loops if you scrape multiple search terms in one run, otherwise each topic carries leftover rows from the previous search.

Power Automate Desktop also includes a "Run JavaScript function on web page" action. If a stubborn element refuses to cooperate with CSS selectors, running two lines of plain JavaScript inside the browser tab can often read the value directly.

What the free Windows version leaves out

Microsoft includes Power Automate Desktop on Windows 11 at no extra cost, and Windows 10 users can download it free as well. With a personal or standard Microsoft 365 account, you can build scrapers and run them locally whenever you want.

That free tier only covers attended flows, meaning a person sits at the computer and presses Run. Once you want a scraper to run on a schedule overnight, trigger from a cloud flow, or share across a team, licensing rules kick in. Power Automate Premium costs $15 per user per month on an annual plan and adds cloud-triggered attended runs along with local scheduling through Windows Task Scheduler.

Running unattended bots - flows that sign into a machine on their own with no human present - requires a Process license at $150 per bot per month, or $215 if Microsoft hosts the virtual machine. Unattended runs also carry strict Windows constraints that trip up people testing on laptops. If a user session is open or even locked on Windows 10 or 11, an unattended flow will fail to start. Screen resolution shifts and unexpected pop-ups on a fresh remote session can also break flows that worked fine while you watched them run at your desk.

Times when another tool makes more sense

Power Automate Desktop fits well for small and medium business tasks, though it runs into hard limits quickly. Knowing where it struggles saves you from forcing an automation tool onto the wrong problem:

  • Strict anti-bot defenses like Cloudflare checks and CAPTCHAs will stall a desktop flow just as fast as a human visitor, since the app has no built-in solver or proxy rotation.
  • Infinite scroll feeds without a clear "Next" button won't work with the Live web helper's pager setting, forcing you into awkward JavaScript scroll loops and duplicate-row cleanup.
  • High-volume scraping across tens of thousands of pages feels sluggish compared to headless code libraries like Playwright or Scrapy, because a full browser instance carries heavy memory and rendering overhead.
  • Sites that redesign their front-end layouts every few weeks require constant selector maintenance, which becomes tedious if you manage dozens of separate flows.
  • Simple internal reports that already live in clean HTML tables or open JSON endpoints are much faster to pull using Excel's Power Query without launching a browser at all.

For a team that already lives inside Windows and Excel, Power Automate Desktop is still a practical option. You can spend twenty minutes setting up a flow to pull competitor pricing or portal records straight into a spreadsheet without asking a developer for help. Keep your expectations realistic on speed, test your selectors across a few page reloads, and check the licensing math before promising anyone an automated overnight feed.


r/WebDataDiggers • • 21h ago

How to scrape pages that delete old items as you scroll

1 Upvotes

You open a classifieds site or product directory, see 250 results listed at the top, tell Playwright to scroll to the bottom, and run your selector. Then you check your CSV and only find 18 items. Nothing crashed, no error popped up, and the missing 232 items simply vanished.

That happens because modern websites use virtual scrolling. Instead of keeping hundreds of heavy HTML cards loaded in memory at once, the page acts like a small moving window. It only keeps about 15 or 20 cards inside the browser DOM at any moment. Every time you scroll down to load new cards at the bottom, the page deletes the old cards at the top. If your script waits until the bottom to read the page, most of the list is already gone.

There are two straightforward ways to catch every single item before it disappears.

Watch the background data instead of reading the HTML

Almost every infinite scroll grid loads new items by quietly calling a JSON endpoint in the background as you move down the page. Rather than chasing changing HTML tags, you can tell Playwright to listen to network responses and copy each fresh batch the instant it arrives.

Open Chrome DevTools on the Network tab, filter by Fetch/XHR, and scroll down once by hand. Look for a request returning a JSON list of items, such as /api/listings?cursor=20. Once you spot part of that URL, plug it into a response listener:

from playwright.sync_api import sync_playwright

all_items = []

def catch_api(response):
    if "/api/listings" in response.url and response.status == 200:
        try:
            data = response.json()
            all_items.extend(data.get("results", []))
        except Exception:
            pass

with sync_playwright() as p:
    browser = p.chromium.launch(headless=True)
    page = browser.new_page()
    page.on("response", catch_api)
    page.goto("https://example-site.com/listings")

    for _ in range(20):
        page.mouse.wheel(0, 1200)
        page.wait_for_timeout(1500)

    browser.close()

print(f"Collected {len(all_items)} items")

Because catch_api grabs the raw JSON straight off the wire, it does not matter whether the page deletes cards from the screen two seconds later. You get cleaner data with zero HTML parsing.

Save cards after every small scroll

Sometimes a site mixes its data inside weird HTML blocks or obfuscated streams where reading the page directly is easier. In that case, stop jumping straight to the bottom. Scroll down less than one screen at a time and save visible cards into a Python dictionary after every move.

Using a dictionary keyed by each item's link or ID solves two problems at once: it saves cards before the page erases them, and it automatically removes duplicates when two scroll steps overlap.

from playwright.sync_api import sync_playwright

seen = {}
empty_scrolls = 0

with sync_playwright() as p:
    browser = p.chromium.launch(headless=True)
    page = browser.new_page()
    page.goto("https://example-site.com/listings")

    while empty_scrolls < 3:
        before = len(seen)

        for card in page.locator("a.listing-card").all():
            link = card.get_attribute("href")
            if link and link not in seen:
                seen[link] = card.inner_text()

        # Move down 70% of the screen height so nothing gets skipped
        page.evaluate("window.scrollBy(0, window.innerHeight * 0.7)")
        page.wait_for_timeout(1200)

        if len(seen) == before:
            empty_scrolls += 1
        else:
            empty_scrolls = 0

    browser.close()

print(f"Collected {len(seen)} unique items")

Four habits that keep scroll loops from cutting off early

  • Scroll inside the actual container when the whole window does not move, since some dashboards put the scrollbar inside a specific div rather than window.
  • Keep each scroll step smaller than the screen height (around 70% works well) so fast jumps never skip right over a batch of cards between frames.
  • Wait for two or three empty scroll rounds before stopping, because a slow network reply on a single scroll can look like the end of the list.
  • Watch for a "Show more" button halfway down, as many feeds auto-scroll for three pages and then pause until someone clicks a button.

Once you treat an infinite scroll page like a moving stream rather than a static document, those missing items stop disappearing and your counts match what the website advertises at the top.