# Milanuncios Scraper (by url)

Collect titles, prices, locations, images, and descriptions from Milanuncios search or individual ad URLs.

- Template page: [https://www.octoparse.com/template/milanuncios-scraper](https://www.octoparse.com/template/milanuncios-scraper)
- Categories: 
- Status: `PUBLISHED`
- Run mode: `CLOUD`

## Pricing

Current price: **$0.01/1,000 lines**. Billing is based on output rows; an Octoparse subscription may be required.

## What is an Octoparse template?

An Octoparse template is a ready-to-use scraping workflow with predefined inputs and structured outputs. Use the exact parameter keys below; do not invent parameters.

## Overview

This ready-to-use template collects structured data from web pages.

## Output

The current workflow extracts 5 fields, including `Imagen`, `Lugar`, `Precio`, `Título`, `descripción`.

## Use Cases

- Use structured results for research, comparison, and monitoring.
- Collect rows without building the extraction workflow from scratch.
- Combine results with other templates for downstream enrichment.
- Review a representative result before starting a large batch.

## Why Octoparse

- **No coding required:** complete url, pageSize and start the template in cloud mode.
- **Flexible export:** review and export results as CSV, Excel, or JSON.

## Input

### url

Required. urls

### pageSize

Optional. Number of pages (1-200) Constraints: minimum=1, maximum=200.

## How to Use

# Milanuncios Scraper (by URL)

Short guide for using the Octoparse public template **"Milanuncios Scraper (by url)"**.

## 1. Get the template
1. Log in to Octoparse.
2. Open the **Templates** gallery.
3. Search for `Milanuncios Scraper (by url)`.
4. Click **Use This Template** to create a new task.

## 2. Prepare your target URL
- On Milanuncios, perform the search or open the section you want to scrape.
- Copy the full URL from the browser address bar, keeping all query parameters (filters, category, location).
- The template expects a Milanuncios listing/search URL as its starting point.

## 3. Enter the URL into the task
- In the task wizard, locate the start URL / input box.
- Replace the default URL with your copied Milanuncios URL.
- If you have multiple searches to run, add each as a separate start page where the template supports multiple inputs.

## 4. Review the extraction workflow
- Open the workflow editor and check the pre-built steps: navigation, waiting, pagination, and data extraction.
- Verify the selectors still match the current Milanuncios page structure. If the site changed, re-pick the relevant XPath/CSS selectors inside the **Extract** step.
- Adjust pagination or "load more" handling if the listing uses infinite scroll.

## 5. Run the task
- Click **Run** to run locally, or choose **Cloud Extraction** for scheduled/scaled runs.
- For large volumes, prefer cloud mode to avoid local machine limits.

## 6. Export the data
- Go to the task's **Data** tab after the run finishes.
- Click **Export** and choose CSV, Excel, or JSON.

## Legal & safety notes
- Respect Milanuncios' terms of service and `robots.txt`.
- Keep request delays reasonable to avoid overloading the site.
- Do not use scraped data for spam or any purpose that violates applicable privacy law (e.g., GDPR).

## Limitations

Results depend on what the source site exposes at run time. Fields may be empty when a source page does not provide a value. The template enforces the input limits shown above.

## Tips

Use specific, valid inputs and review a representative result before starting a large batch. Remove duplicate inputs when repeated records are not needed.

## FAQ

### What do I need to enter?

Use the exact inputs and limits listed above.

### What data does this template return?

See Output Schema below; availability can vary by source record.

### How is usage billed?

See the Pricing section above for current pricing and billing details.

## Related Templates

- [Google Local Service Scraper (by URL)](https://www.octoparse.com/template/google-business-local-services-scraper)
- [Twitter Scraper (by Account URL)](https://www.octoparse.com/template/twitter-scraper-by-account-url)
- [Etsy Product Scraper (by URL)](https://www.octoparse.com/template/etsy-product-scraper-by-url)
- [Zillow Listing Scraper (by URL)](https://www.octoparse.com/template/zillow-scraper)
- [Rikunabi NEXT Job Scraper by URL](https://www.octoparse.com/template/rikunabi-next-job-scraper)

## Input Schema

```json
{
  "title": "Milanuncios Scraper (by url) input",
  "description": "Input parameters configured for the current published template version.",
  "type": "object",
  "schemaVersion": 1,
  "additionalProperties": false,
  "properties": {
    "url": {
      "title": "url",
      "description": "urls",
      "type": "array",
      "items": {
        "type": "string"
      },
      "x-octoparse": {
        "apiEnabled": false
      }
    },
    "pageSize": {
      "title": "pageSize",
      "description": "Number of pages (1-200)",
      "type": "integer",
      "minimum": 1,
      "maximum": 200,
      "x-octoparse": {
        "apiEnabled": false
      }
    }
  },
  "required": [
    "url"
  ]
}
```

## Input JSON Example

Example 1

```json
{
  "pageSize": 1.0,
  "url": [
    "https://www.milanuncios.com/anuncios/?s=chaleco&orden=relevance&fromSearch=1&fromSuggester=0&suggestionUsed=0&hitOrigin=listing&recentSearchShowed=0&recentSearchUsed=0"
  ]
}
```

Example 2

```json
{
  "pageSize": 1.0,
  "url": [
    "https://www.milanuncios.com/anuncios/?s=chaleco&orden=relevance&fromSearch=1&fromSuggester=0&suggestionUsed=0&hitOrigin=listing&recentSearchShowed=0&recentSearchUsed=0"
  ]
}
```

Example 3

```json
{
  "pageSize": 2,
  "url": [
    "https://www.milanuncios.com/anuncios/?s=chaleco&orden=relevance&fromSearch=1&fromSuggester=0&suggestionUsed=0&hitOrigin=home_search&recentSearchShowed=0&recentSearchUsed=0"
  ]
}
```

Example 4

```json
{
  "url": [
    "https://www.milanuncios.com/anuncios/?s=chaleco&orden=relevance&fromSearch=1&fromSuggester=0&suggestionUsed=0&hitOrigin=home_search&recentSearchShowed=0&recentSearchUsed=0"
  ]
}
```

Example 5

```json
{
  "pageSize": 1,
  "url": [
    "https://www.milanuncios.com/anuncios/?s=chaleco&orden=relevance&fromSearch=1&fromSuggester=0&suggestionUsed=0&hitOrigin=home_search&recentSearchShowed=0&recentSearchUsed=0"
  ]
}
```


## Output Schema

```json
{
  "schemaVersion": 1,
  "type": "object",
  "properties": {
    "Imagen": {
      "type": "string",
      "description": ""
    },
    "Lugar": {
      "type": "string",
      "description": ""
    },
    "Precio": {
      "type": "string",
      "description": ""
    },
    "Título": {
      "type": "string",
      "description": ""
    },
    "descripción": {
      "type": "string",
      "description": ""
    }
  },
  "title": "Milanuncios Scraper (by url) output",
  "description": "Initial output fields derived from the current published implementation. Field descriptions are maintained by Data Center; production field names and types should be refreshed from recent successful runs.",
  "additionalProperties": false
}
```

## Output Example

Example 1

```json
{
  "Imagen": "https://images.milanuncios.com/api/v1/ma-ad-media-pro/images/428febca-1de1-4ee7-8433-dd26a04e5e9e",
  "Lugar": "A Coruña, A Coruña",
  "Precio": "25 EUR",
  "Título": "chaleco",
  "descripción": "Chaleco de armería Álvarez. Marca Imperator. Talla XL"
}
```

Example 2

```json
{
  "Imagen": "https://images.milanuncios.com/api/v1/ma-ad-media-pro/images/a3551346-349e-414b-b6de-1c65a0de8450",
  "Lugar": "El Puerto de Santa Maria, Cádiz",
  "Precio": "3 EUR",
  "Título": "Chaleco",
  "descripción": "Chaleco niña de pelito hago envíos ."
}
```

Example 3

```json
{
  "Imagen": "https://images.milanuncios.com/api/v1/ma-ad-media-pro/images/4bd37a38-0a90-491e-9a99-ab78a6587034",
  "Lugar": "Lorca, Murcia",
  "Precio": "20 EUR",
  "Título": "Chaleco",
  "descripción": "Chaleco para mujeres. A prueba de ducha. Patrón de arco iris. Talla Mediana. En buen estado."
}
```

Example 4

```json
{
  "Imagen": "https://images.milanuncios.com/api/v1/ma-ad-media-pro/images/428febca-1de1-4ee7-8433-dd26a04e5e9e",
  "Lugar": "A Coruña, A Coruña",
  "Precio": "25 EUR",
  "Título": "chaleco",
  "descripción": "Chaleco de armería Álvarez. Marca Imperator. Talla XL"
}
```

Example 5

```json
{
  "Imagen": "https://images.milanuncios.com/api/v1/ma-ad-media-pro/images/929e8baf-aacc-46ec-b907-d2375a7d7b34",
  "Lugar": "Vitoria/Gasteiz, Álava",
  "Precio": "20 EUR",
  "Título": "Chaleco",
  "descripción": "Chaleco de hombre talla l color verde marca Springfield"
}
```

## API

`POST https://openapi.octoparse.com/api/agentTools/executeTask`

This is the OpenAPI Agent Tools `executeTask` endpoint. Authenticate with a Bearer token.

Request body:

`templateName` is the template slug; `parameters` is a JSON object string whose keys match Input Schema; `taskName`, `idempotencyKey`, and `maxCollectedRows` are optional.

Obtain a token:

```http
POST https://openapi.octoparse.com/token
Content-Type: application/json

{
  "username": "YOUR_USERNAME",
  "password": "YOUR_PASSWORD",
  "grant_type": "password"
}
```

Use `data.access_token` as `Authorization: Bearer <token>`. After starting, poll `getTaskStatus` and export with `exportData`.

```json
{
  "templateName": "milanuncios-scraper",
  "taskName": "Milanuncios Scraper (by url)",
  "parameters": "{\"pageSize\":1.0,\"url\":[\"https://www.milanuncios.com/anuncios/?s=chaleco&orden=relevance&fromSearch=1&fromSuggester=0&suggestionUsed=0&hitOrigin=listing&recentSearchShowed=0&recentSearchUsed=0\"]}"
}
```

## Python Example

```python
import json
import requests

OPENAPI_BASE = "https://openapi.octoparse.com"
ACCESS_TOKEN = "YOUR_ACCESS_TOKEN"

parameters = json.loads("{\"pageSize\":1.0,\"url\":[\"https://www.milanuncios.com/anuncios/?s=chaleco&orden=relevance&fromSearch=1&fromSuggester=0&suggestionUsed=0&hitOrigin=listing&recentSearchShowed=0&recentSearchUsed=0\"]}")

response = requests.post(
    f"{OPENAPI_BASE}/api/agentTools/executeTask",
    headers={
        "Authorization": f"Bearer {ACCESS_TOKEN}",
        "Content-Type": "application/json",
    },
    json={
        "templateName": "milanuncios-scraper",
        "taskName": "Milanuncios Scraper (by url)",
        "parameters": json.dumps(parameters, ensure_ascii=False),
    },
    timeout=60,
)
print(response.status_code)
print(response.json())
```

## HTTP/cURL Example

```bash
curl -X POST "https://openapi.octoparse.com/api/agentTools/executeTask" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  --data-binary @- <<'JSON'
{
  "templateName": "milanuncios-scraper",
  "taskName": "Milanuncios Scraper (by url)",
  "parameters": "{\"pageSize\":1.0,\"url\":[\"https://www.milanuncios.com/anuncios/?s=chaleco&orden=relevance&fromSearch=1&fromSuggester=0&suggestionUsed=0&hitOrigin=listing&recentSearchShowed=0&recentSearchUsed=0\"]}"
}
JSON
```

## MCP Setup

Connect an MCP-compatible AI client to `https://mcp.octoparse.com` using browser OAuth or an Octoparse API key. Find `milanuncios-scraper`, inspect its inputs, create a cloud task with the exact Input Schema keys, and export JSON results.

## Machine-readable Resources

- [Template contract](https://www.octoparse.com/templates/milanuncios-scraper.json)
- [Manifest](https://www.octoparse.com/templates/milanuncios-scraper-manifest.json)
