> ## Documentation Index
> Fetch the complete documentation index at: https://docs.browseract.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Case 4: Precise Scraping with Conditional Filtering

> Learn how to filter and scrape only specific items from a list based on criteria (e.g., discounts) using conditional logic, with eBay as an example.

## 1. Case Overview

This case demonstrates a very common e-commerce scenario: The list contains many items, but we only want to scrape those that **"meet specific criteria"** and skip the rest.

In this example, we open an eBay search result page for laptops and check the first 10 items one by one:

* **Check:** Does this item have a "Bulk Savings" discount text? (e.g., *Save up to 10% when you buy more*).
* **If Yes:** Record the **Product Name + Price**.
* **If No:** Skip this item immediately and look at the next one.

**Key Logic:**

1. [**Loop List**](/learn/basics/node-types/loop-list-node)**:** Responsbile for focusing on each product card sequentially.
2. [**Condition**](/learn/basics/node-types/condition-node)**:** Performs a judgment on each product.
   * **True:** Execute subsequent scraping nodes.
   * **False:** Do nothing, automatically skipping to the next product.

Although this case uses eBay, this **"List Traversal + Condition Filtering"** logic is universal for any website where only a subset of items in a list match your needs, such as:

* Scraping only discounted items.
* Scraping only items with a "Prime" badge.
* Scraping only content tagged "New" or "HOT".

<img src="https://mintcdn.com/browseract/zKPYXjjRpK7PQVwb/images/Gemini_Generated_Image_4qya5i4qya5i4qya.png?fit=max&auto=format&n=zKPYXjjRpK7PQVwb&q=85&s=322fa74d335a5dc1a26c704bac39999a" alt="Gemini_Generated_Image_4qya5i4qya5i4qya.png" width="2752" height="1536" data-path="images/Gemini_Generated_Image_4qya5i4qya5i4qya.png" />

## 2. Detailed Steps

### 1. [Visit Page](/learn/basics/node-types/visit-node) (Open Search Results)

* **Objective:** Simulates opening a browser and entering the eBay search URL.
* **Configuration:**
  * **URL:** `https://www.ebay.com/sch/i.html?_nkw=laptop`
  * **Tab:** Select **Current Tab Access**.
  * **In Abnormal Situation:** Keep **Stop Task**.

<img src="https://mintcdn.com/browseract/ttsqxKB4gCNX_iMz/images/PixPin_2025-12-04_11-32-51.png?fit=max&auto=format&n=ttsqxKB4gCNX_iMz&q=85&s=fc0ad7d87490c5234c298822f2433b57" alt="PixPin_2025-12-04_11-32-51.png" width="857" height="543" data-path="images/PixPin_2025-12-04_11-32-51.png" />

### 2. [Loop List](/learn/basics/node-types/loop-list-node) (Traverse Product List)

* **Objective:** Tell the AI: "This entire area is the product list. Please process items one by one."
* **Configuration:**
  * **List Region:** Select the main search result area in the middle of the interface. Description example: `In the middle of the interface, the search results list`.
  * **Max items to focus:** Enter `10` (focus on the first 10 items for quick testing).
  * **Auto-click "Load More":** Leave unchecked (eBay uses pagination, not infinite scroll).
  * **In Abnormal Situation:** Keep **Stop Task**.

> **Tip:** As long as the Loop List region is selected accurately, the subsequent logic can be reused regardless of how complex the list is.

<img src="https://mintcdn.com/browseract/ttsqxKB4gCNX_iMz/images/PixPin_2025-12-04_11-32-59.png?fit=max&auto=format&n=ttsqxKB4gCNX_iMz&q=85&s=b55725d0e69f88433b4cd4f2b92f7eb8" alt="PixPin_2025-12-04_11-32-59.png" width="800" height="833" data-path="images/PixPin_2025-12-04_11-32-59.png" />

### 3. [Condition](/learn/basics/node-types/condition-node) (Check for Bulk Discount)

* **Important:** This node must be placed **inside** the **Loop List** node. This ensures the condition applies to the "currently focused product card."
* **Objective:** Check the description area of the current product: Is there a bulk purchase discount prompt like *"Save up to 10% when you buy more"*?
* **Configuration:**
  * **Condition Description:** `Are there discounts for bulk purchases? For example, "Save up to 10% when you buy more."`
  * **In Abnormal Situation:** Keep **Stop Task**.
* **Logic Explanation:**
  * **True Branch:** The product has the discount text → Considered a "matching item," proceed to scrape.
  * **False Branch:** The product lacks this text → Do nothing, automatically return to Loop List to check the next item.

<img src="https://mintcdn.com/browseract/QuooOdjd8FVGRxp0/images/PixPin_2025-12-04_11-35-49.png?fit=max&auto=format&n=QuooOdjd8FVGRxp0&q=85&s=6a12a75fbc356b48ea8427ab8f7371f2" alt="PixPin_2025-12-04_11-35-49.png" width="673" height="531" data-path="images/PixPin_2025-12-04_11-35-49.png" />

### 4. [Extract Data Item](/learn/basics/node-types/extract-data-item-node) (True Branch: Scrape Matching Items)

* **Context:** This node is placed on the **True** branch of the Condition node.
* **Objective:** Copy the core information of this "discounted product."
* **Configuration:**
  * **Data Field:** Define the fields you need, for example:
    * **Product Name**
    * **Product Price**
  * **Selection:** Select the title and price elements on the current product card.
  * **Filtering Criteria:** Leave unchecked.
  * **In Abnormal Situation:** Keep **Stop Task**.

> **Note:** The **Extract Data Item** only applies to the "current item." The Loop List handles moving the focus to the next item automatically.

<img src="https://mintcdn.com/browseract/QuooOdjd8FVGRxp0/images/PixPin_2025-12-04_11-36-01.png?fit=max&auto=format&n=QuooOdjd8FVGRxp0&q=85&s=25c51705ffc42568901ebdeb53bc0d25" alt="PixPin_2025-12-04_11-36-01.png" width="626" height="579" data-path="images/PixPin_2025-12-04_11-36-01.png" />

### 5. Finish (Output Results)

* **Objective:** After the Loop List finishes processing the first 10 items, compile all "matching items" into structured data.
* **Configuration:**
  * **Output Format:** Select **CSV** or **JSON** based on your needs.
  * **Output as a file:** Check this if you want a direct download link.
  * **In Abnormal Situation:** Keep **Stop Task**.

> **Result:** The final export will be a list containing only the "Discounted Items" with their names and prices.

<img src="https://mintcdn.com/browseract/QuooOdjd8FVGRxp0/images/PixPin_2025-12-04_11-36-09.png?fit=max&auto=format&n=QuooOdjd8FVGRxp0&q=85&s=2dbfd54529ea7b3739f498d673b369d4" alt="PixPin_2025-12-04_11-36-09.png" width="889" height="559" data-path="images/PixPin_2025-12-04_11-36-09.png" />

## 3. Human Operation vs. AI Nodes

To better understand the workflow, compare how a human operates versus how the AI nodes are structured.

| **Your Action (Human Operation)**                                            | **Corresponding AI Node**           | **Function Description**                                                          |
| :--------------------------------------------------------------------------- | :---------------------------------- | :-------------------------------------------------------------------------------- |
| **Open browser**, enter eBay laptop search URL.                              | **Visit Page**                      | Opens the target search result page to start the task.                            |
| **Look** at the long list of search results, ready to check them one by one. | **Loop List**                       | Tells the AI: "This entire area is the product list," and iterates through items. |
| **Glance** at a product card: Does it say "Save up to 10%..."?               | **Condition** (Inside Loop List)    | Judges the current item: Has Discount → True; No Discount → False.                |
| **If Yes (True):** Write down the name and price in your notebook.           | **Extract Data Item** (True Branch) | Executes only when Condition is True, extracting Product Name and Price.          |
| **If No (False):** Ignore it and look at the next item.                      | **False Branch** (Empty)            | No action is taken. The Loop List automatically moves focus to the next item.     |
| **Final Step:** Save the list of "Discounted Items" you collected.           | **Finish**                          | Compiles all recorded data and exports it as CSV/JSON.                            |

### Summary

The essence of this case is **"Filter first, then Scrape"** rather than scraping everything.

1. **Loop List** handles "Looking one by one."
2. **Condition** handles "Do I want this?"
3. **Extract Data Item** handles "If I want it, write it down."

Whenever you have a requirement like **"Only scrape items that are On Sale / Prime / Specific Tag,"** you can simply build this **Loop List + Condition + Extract Data Item** combination.
