import { Image } from "astro:assets";
import StoreCta from "../../components/StoreCta.astro";
import orderResults from "../../assets/screenshots/article-authenticated-orders.png";

To export data from a website behind login to CSV, sign in normally in Chrome, select that tab in [Tab Automation](/), and use **Save Text** to collect the fields you need. For several record pages, put Save Text inside **For Each Link**, run a short URL list, then review and export the dataset.

If the portal already offers an export with the right fields, use it. This recipe is for the weekly report that otherwise means opening each order, copying its status, and pasting it into a spreadsheet. It works with visible text on similarly structured record pages your signed-in tab can open. You do not need to copy cookies or put your password into the automation.

**This recipe saves one row per visited order.** It uses one Save Text step inside Each Link and gets three rows by visiting three order-detail URLs. Selecting a table or a list of cards does not automatically turn every item into a separate row.

## See a three-order export

We ran an unpacked test build of Tab Automation 1.0.0 against an internal **Fieldwork supplier portal**. A demo sign-in form set a session cookie; order pages redirected to sign-in without it. The orders and dates below are controlled demo data, not live supplier information.

The configuration was a pasted list of three URLs, with **Wait / Delay → Fixed → 5 seconds** followed by **Save Text** inside Each Link. The fields were **Order ID**, **Status**, and **Expected dispatch**. **Repeat** was off and **Skip visited** was **Never**. We first made a separate Test save and verified that it was excluded from the batch export.

| Order ID | Status            | Expected dispatch |
| -------- | ----------------- | ----------------- |
| PO-1042  | Processing        | 6 October 2026    |
| PO-1043  | Ready to dispatch | 5 October 2026    |
| PO-1044  | Awaiting stock    |                   |

The third order deliberately has no selected dispatch-date element. Its cell stays blank and the CSV records `Expected dispatch: Element is missing or hidden.` It does not reuse the date from the previous order.

<figure style="margin: 1.5rem 0;">
  <a href={orderResults.src}>
    <Image
      src={orderResults}
      alt="Actual Dashboard dataset with three demo supplier orders and a missing expected-dispatch field for PO-1044."
      loading="lazy"
      style="display: block; max-width: 100%; height: auto; border-radius: 12px;"
    />
  </a>
  <figcaption style="margin-top: 0.65rem; color: var(--secondary); font-size: 0.875rem; line-height: 1.5;">
    Results from the signed-in collection. Open the full-size image to inspect the rows.
  </figcaption>
</figure>

[Download the actual order CSV](/samples/guides/authenticated-orders.csv). It includes the recorded source URLs, UTC timestamps, and warning. The local addresses identify our internal test pages; they are not a public practice portal.

Start with two or three records from your own portal and compare the output with the pages before collecting a larger list.

<StoreCta fallback="/#how-it-works" showNote={false} placement="guide-demo" />

## Sign in and test one record

Use desktop Chrome with Tab Automation installed. Custom automations are free. [Explorer access](/blog/launch-license) unlocks the full Dashboard shown here; the basic saved-results list also provides exports.

1. Sign in to your portal yourself, including any multi-factor prompt, and open an order-detail page. Wait until the fields you need are visible.
2. Open the Tab Automation side panel and choose **New Automation**. Under **Tab & Startup**, turn off **Run in a new tab** and select the signed-in tab. Leave **Start when browser opens** off for this manually started report.
3. Choose **Add Step → Save Text → Pick text**. Pick the order ID, status, and expected dispatch date. Give the columns those names, then choose **Done**.
4. Check the preview against the page. Use **Reveal**, **Repick**, or **Edit selector** if a field points at the wrong text. The selector identifies which page element to read; the same selections must work on each record.
5. Choose **Test save**. Open **Dashboard → Saved results**, find the separate Test dataset, and confirm its values and source URL.
6. Open a second order in the assigned tab and choose **Refresh preview** on Save Text. Check that the preview now contains the second order's values. Refresh preview reads the page without saving another row.

Pick an order with all three fields when configuring the example. Missing fields on later records can be reviewed as warnings. If the second page has a different layout, fix the selections and check both pages before running the list.

## Collect the order-detail URLs

Create a fresh automation for the batch. Under **Tab & Startup**, turn off **Run in a new tab**, select the same signed-in tab, and leave **Start when browser opens** off. Name it something recognizable, such as `Weekly supplier orders`.

1. Add [For Each Link](/steps/for-each-link), choose **Paste list**, and enter two or three complete `https://` or `http://` order-detail URLs, one per line. Start with a new loop without a picked link selector; live selector matches take priority over a pasted list.
2. Inside **Each Link**, add [Wait / Delay](/steps/wait-delay). Select **Fixed** and enter **5 seconds**. Adjust this after checking how long your portal takes to display its fields; a fixed wait does not verify that loading succeeded.
3. Add [Save Text](/steps/save-text) after the wait, also inside Each Link. Open **Go To This Link → Open** beside the first URL, then pick and name the same three fields used in your test.
4. Finish picking, open a second URL with **Go To This Link → Open**, and choose **Refresh preview**. Confirm that the order ID and other fields belong to that URL. Repeat for any different page layout in the list.
5. Set **Skip visited** to **Never** so deliberate repeat exports can revisit these URLs. Turn **Repeat** off in the End block for one pass.
6. Choose **Save & Run**. Keep Chrome open and leave the assigned tab to the automation while it visits each record.

Use the direct record URLs, not a search-results URL whose filters exist only in the current page. Open each sample to check that navigation preserves the record or view you need. This recipe does not discover every order, follow pagination automatically, or collect rows that a virtualized table has not rendered.

For longer lists, the [link-walking guide](/blog/walk-through-links-in-chrome) explains how to collect and filter links. A private portal is a reason to start with a pasted list: the sitemap source does not authenticate to protected sitemaps using your tab's session.

## Check the rows and export CSV

When the pass finishes, open **Dashboard → Saved results**, filter by **Text Dataset**, and open the dataset from `Weekly supplier orders`. Keep the earlier Test dataset separate.

Compare the row count with your URL list, then check each order ID and **Source URL**. Read the warnings and inspect any blank or unexpected value on its original page. A completed run means the steps finished; it does not establish that the account, record, or field selection was correct.

Choose **Export… → CSV → Export** to download the dataset. Export is unavailable while the run is running; finish the pass or pause it to export the rows already saved. Saving rows in Results does not automatically download a file.

The CSV contains your named fields plus **Source URL**, **Saved at**, and **Warnings**. Saved at is a UTC timestamp. Dates and statuses remain displayed text rather than being converted into spreadsheet dates or categories. You can import the file into a spreadsheet, but this automation does not create an XLSX workbook or keep Excel or Google Sheets synchronized.

## Recover when the session expires

In the same demo, we cleared only the supplier portal's session cookie and ran a fresh one-order collection. The requested order redirected to sign-in. The run still completed, but its row recorded the login URL, three blank fields, and three missing-or-hidden warnings.

**A missing-field warning is not an authentication detector.** The same warning can mean that content has not loaded or the page layout changed. Some sites also show a login form without changing the URL. Inspect the page and the selected values as well as the run status.

If the portal has signed you out:

1. Pause any active run and sign in again yourself.
2. Open an affected record URL and check that the expected content is visible.
3. Refresh the preview and make a new **Test save** before collecting more records.
4. Create a fresh short batch containing only the records you need to collect again. Review its rows and export it separately from the incomplete result.

After signing back into our demo, we ran the affected order again and verified all three fields and a fresh CSV with no warnings. The sign-in form restored access; the automation did not renew the session. This checks our controlled cookie-and-redirect example, not compatibility with every portal or login system.

If you are still signed in, check the selected field with Reveal or Repick and allow more loading time where needed. A longer delay cannot repair a selector that points at the wrong element.

## Reuse the setup for your next report

Before the next collection, sign in, review the URL list, and refresh the preview on a sample record. Keep **Repeat** off for a single pass and **Skip visited → Never** for deliberate revisits. The default **Timed** policy remembers visits for 24 hours; **Always** skips remembered URLs.

A new run creates a new dataset rather than updating last week's rows or replacing an existing spreadsheet. Export each report you want to keep independently. Results remain local in this browser; uninstalling the extension or clearing its storage removes them.

For public catalog pages, follow the [general web-page-to-CSV guide](/blog/extract-text-web-pages-csv-chrome). If the report also needs a visual reference, [capture screenshots of signed-in pages](/blog/screenshot-pages-behind-login-chrome) and inspect them for expired sessions before sharing.
