> For the complete documentation index, see [llms.txt](https://docs.zerowork.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zerowork.io/using-zerowork/using-building-blocks/save-web-element.md).

# Save Web Element

<figure><img src="https://3220183989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg9LcR8XM7TGOzOCDGsCS%2Fuploads%2FIhE8mCb59d4zaz0bBs2i%2Fsave_web_element_block.png?alt=media&amp;token=434c92d8-325a-413f-9cb7-48dac1fc35ed" alt="" width="375"><figcaption></figcaption></figure>

The **Save Web Element** block reads data from an element on the page (its text, a link, an image, an attribute, or its HTML) and saves it into a column in your TaskBot's [native table](/using-zerowork/using-tables/native-tables.md), [Google Sheet](/using-zerowork/using-tables/google-sheets.md), or a [ZeroWork variable](/using-zerowork/using-variables.md). It's the main block for scraping data off a page.

{% hint style="warning" %}
**Using this block requires a ZeroWork variable, native table, or Google Sheet.** It saves its result to a variable or table / sheet column, so if you haven't created one yet, do that first. See [Using Variables](https://docs.zerowork.io/using-zerowork/using-variables) and [Using Tables](https://docs.zerowork.io/using-zerowork/using-tables).
{% endhint %}

## How To Use It

<figure><img src="https://3220183989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg9LcR8XM7TGOzOCDGsCS%2Fuploads%2FmkczXO3y7CNWtnCMJ0Ka%2Fsave_web_element_settings.png?alt=media&amp;token=b898a531-45e3-4d5a-a6fc-a0740d0c3526" alt=""><figcaption></figcaption></figure>

### Web Element Selector

The CSS or XPath selector for the element to read. See [Using Selectors](https://docs.zerowork.io/using-zerowork/using-selectors).

{% hint style="info" %}
If your selector matches more than one element, the first match is used.
{% endhint %}

#### Timeout

How long to wait for the element to appear before giving up, in seconds. The default is **0.8 seconds**. Raise it if the element can take a moment to load.

### Save As

What to pull from the element:

* **Text**: the visible text inside the element.
* **Link**: the element's link (its `href`), returned as a full URL.
* **Image**: the image's source (its `src`), returned as a full URL. The element must be an image.
* **Custom attribute**: the value of an attribute you name, such as `title`, `value`, or `data-id`. A second field appears for the attribute name, and it accepts [dynamic inputs](https://docs.zerowork.io/using-zerowork/using-building-blocks/dynamic-inputs), so the attribute to read can be set at runtime. (Refer to the below screenshot)
* **HTML**: the element's full HTML (its `outerHTML`).

{% hint style="success" %}
**Link** and **Image** always come out as complete URLs; a relative address on the page (like `/product/123`) is resolved against the current page for you, so what you save is ready to open or store.
{% endhint %}

<figure><img src="https://3220183989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg9LcR8XM7TGOzOCDGsCS%2Fuploads%2F95qVqRM3TZfUPcaOf70r%2Fsave_web_element_save_as_custom_attribute.png?alt=media&amp;token=c9eee413-bb4c-424b-a310-61167461df1c" alt=""><figcaption></figcaption></figure>

### Skip if no element is found

By default the block fails and the run stops if the element isn't on the page, or if it's found but the value you asked for is absent (an unset **Custom attribute**, or a **Link**/**Image** element with no `href`/`src`).&#x20;

Turn this option on to log a warning and **continue** your TaskBot's run instead, leaving the value blank. This is useful when a field is only present on some pages.

### Save to

Where the value is stored:

* **A table** (a ZeroWork **native table** or a connected **Google Sheet**) writes the value into a column. In a [Start Repeat](https://docs.zerowork.io/using-zerowork/using-building-blocks/start-repeat) loop, each pass writes to a new row or updates an existing one.
* **A variable**: a ZeroWork variable that holds the value for use later in the same run.

{% hint style="success" %}
To save a whole list, put this block inside a [Start Repeat](https://docs.zerowork.io/using-zerowork/using-building-blocks/start-repeat) loop so each pass writes or updates a row. See [Save Lists](https://docs.zerowork.io/using-zerowork/using-building-blocks/save-web-element/save-lists) and [Enrich Existing Data](https://docs.zerowork.io/using-zerowork/using-building-blocks/save-web-element/enrich-existing-data) for two common set-ups.
{% endhint %}

#### Block-level Delays

**Min sec** and **Max sec** represent a pause after the value is saved, before the next block runs. The wait is randomized between the two values, and setting both to the same number makes it fixed. This block defaults to **0**, meaning no pause.

{% hint style="info" %}
See the [Delay](https://docs.zerowork.io/using-zerowork/using-building-blocks/delay) block for how these two fields behave, including decimals, references, and what happens when a field is left empty. See [Delay Times between the Building Blocks](https://docs.zerowork.io/using-zerowork/using-building-blocks/building-block-options/delay-times-between-the-building-blocks) for how block-level delays fit into a TaskBot's run.
{% endhint %}

## Things To Know

* **It saves one value each time it runs.** One Save Web Element block writes one value to one destination: a table / sheet column or a variable. Put it in a [Start Repeat](https://docs.zerowork.io/using-zerowork/using-building-blocks/start-repeat) loop to fill a whole column down a list, and use several of these blocks to fill several columns per row.
* **Text saves the raw underlying text, not exactly what you see.** It grabs the element's full text content, including text inside nested tags (even hidden ones) and the page's original spacing and line breaks, which can differ from what's rendered on screen. If you get extra text or odd whitespace, target a more specific element, or tidy it up afterward with a [Format Data](https://docs.zerowork.io/using-zerowork/using-building-blocks/format-data) block.
* **The value you want may be in an attribute, not the visible text.** A price shown as `$1,234.00` might sit in `data-price="1234"`, and a shortened link's real target is in its `href`. When the on-screen text is formatted or truncated, **Custom attribute** can often get you the clean underlying value.
* **Image reads the source, not the picture.** It saves the image's URL (`src`), not the image file itself. To download the actual image file, pass that URL to a subsequent [Save File](https://docs.zerowork.io/using-zerowork/using-building-blocks/save-file) block; to capture how the image *looks on the page* as rendered, use [Take Screenshot](https://docs.zerowork.io/using-zerowork/using-building-blocks/take-screenshot) block instead.

## Block Behavior

**When the element is found with a value** this block saves it to the column and logs that it saved the value.

**When the value hasn't loaded yet** the block retries a few times over a short window before treating the element as empty, so it handles content that fills in just after the element appears.

**When the element is missing, or its requested value is absent** (an unset Custom attribute, or a Link/Image with no URL) the block stops the run by default, or, with the **Skip if no element is found** option turned on, logs a warning, saves nothing, and continues. An element found with empty text instead saves as an empty value.

**When the type is Link or Image** the saved value is a complete, absolute URL, even if the page used a relative address.

## Use Cases

Typically, there are two main categories when data is saved: Saving lists and enriching existing data.

**Examples of saving lists**

* Save a list of profiles from LinkedIn to a table (to contact them later or to move them to your CRM)
* Save FB group members
* Save a list of products in a certain category on Amazon to analyze competitors' prices and new products

See workflow set-up example here: [Save Lists](/using-zerowork/using-building-blocks/save-web-element/save-lists.md).

**Examples of enriching existing data**

* Have an existing list of LinkedIn profiles and visit every profile to save additional information such as about section, current job position, email address, etc.
* Have an existing list of Amazon products and visit every product page to save description, price and latest customer review.

See workflow set-up example here: [Enrich Existing Data](/using-zerowork/using-building-blocks/save-web-element/enrich-existing-data.md).
