Skip to main content

Complete Guide: How to Scrape PcComponentes Using PcComponentes Scraper

Run the PcComponentes Scraper Apify Actor from Python and get prices, PVPR, discounts, sellers and ratings for Spain and Portugal as JSON.

Updated 12 min readMarkdown
Complete Guide: How to Scrape PcComponentes Using PcComponentes Scraper

This complete guide to PcComponentes Scraper shows how to scrape product data from PcComponentes with Python through the Apify API, and get back one typed row per product card: name, brand, category, offer price in euros, PVPR reference price, discount, seller, condition, manufacturer part number, rating and review count.

PcComponentes is an electronics retailer with two stores, pccomponentes.com (Spain) and pccomponentes.pt (Portugal). The Actor saves only rows read from product cards on the search pages.

You will configure the PcComponentes Scraper Apify Actor (reventadata/pccomponentes-scraper), run it from Python, read its rows and use its filters. Prerequisites: Python 3.11+, the apify-client package and an Apify API token. Expect one sitting. The sample row in this guide comes from a capture dated 2026-11-02 (a PcComponentes Spain results page for portatil, 37 product cards), parsed with the Actor's own parser; this guide quotes no run of its own.


TL;DR

In this tutorial, you'll learn how to scrape PcComponentes with the PcComponentes Scraper Apify Actor from Python. Key steps: install apify-client, export APIFY_API_TOKEN, put your terms in searchQueries, pick country (ES or PT), call reventadata/pccomponentes-scraper, and read the rows from the run's default dataset. Filters for condition, price, brand and keywords drop cards before they are saved; sort changes what the site returns.

Expected outcome: a JSON list of products with price, originalPrice and discountPercentage as numbers, ready for a spreadsheet or database.

The Actor: apify.com/reventadata/pccomponentes-scraper.


Prerequisites and setup

You will need:

  1. Python 3.11+ (apify-client 3.3.0 requires it).
  2. The Apify API client for Python.
  3. An Apify account. Apify Console is Apify's web interface; your API token is on its API & Integrations page. The platform documentation starts at docs.apify.com.

Install the client:

pip install "apify-client~=3.0"

The token is a secret. Apify's docs advise giving each token a description and never using one token for several services. The code in this guide reads it from the environment, so it never sits in a script or a commit.

Set the token in your environment:

export APIFY_API_TOKEN="your_apify_token_here"

Understanding PcComponentes Scraper

What it does and how it works

  1. URL building. For each term the Actor builds the store's search URL (/search/?query=<term>), adding &page=N from page 2 and &sort=... for any order but DEFAULT.
  2. Transport. Proxy is handled for you by default.
  3. Result check. The Actor saves only rows read from product cards.
  4. Parsing. Each product card carries id, name, brand, category, price, discount, condition, seller and part number as attributes; the Actor reads those, plus PVPR, rating and review count.
  5. Filtering and saving. Your filters run on each card; kept rows go to the dataset. The walk stops at maxItems, at maxPages, at an empty page, or at a page that keeps nothing and holds fewer than 5 cards.

Limitations

  • The search term is also a filter: a card is kept only when every word of the term appears in the product name.
  • It reads search result cards only, never product pages, so no specifications.
  • Spain and Portugal use the same card markup, but each run reads one store.

Step-by-step walkthrough

Step 1: Initialize the client and define inputs

The main input is searchQueries, one PcComponentes search per term. country takes ES (default) or PT. maxPages (1 to 50, default 5) bounds pages per term and maxItems (1 to 5,000, default 60) caps saved rows across all terms.

This setup searches the Spanish store for portatil (Spanish for laptop), reads one result page and saves at most 5 rows:

import os
from apify_client import ApifyClient

# 1. Initialize ApifyClient with the token from the environment
client = ApifyClient(os.environ["APIFY_API_TOKEN"])

# 2. Search PcComponentes Spain for laptops: one result page, at most 5 rows
run_input = {
    "searchQueries": ["portatil"],
    "country": "ES",
    "maxPages": 1,
    "maxItems": 5,
}

No proxy setting is needed: proxy is handled for you by default.

Two more configurations, as JSON input:

  • Cheapest reconditioned ThinkPads in Spain: {"searchQueries": ["thinkpad"], "country": "ES", "sort": "PRICE_ASC", "condition": "REFURBISHED", "maxItems": 50}.
  • Graphics cards in Portugal within a budget: {"searchQueries": ["rtx 4070"], "country": "PT", "minPrice": 500, "maxPrice": 800, "maxItems": 50}.

Step 2: Configure filters

sort is sent to the site: DEFAULT, PRICE_ASC, PRICE_DESC, BEST_SELLERS, DISCOUNT, RATING or NEWEST. Every other filter runs on the cards after the Actor reads them:

  • condition: ALL, NEW or REFURBISHED. REFURBISHED keeps cards marked reconditioned, plus names containing reacondicionado, recondicionado, refurbished or reaco; NEW keeps the rest.
  • minPrice / maxPrice: offer price bounds in euros. A card without a price is dropped when either is set.
  • brand: keep cards whose brand or name contains it, ignoring case and accents.
  • includeKeywords / excludeKeywords: words the name or brand must all contain / must not contain.

country, sort and condition accept only their listed values; anything else is refused before the run starts.

Step 3: Advanced configuration

The trade-off is reach against volume. maxPages decides how deep each search goes, maxItems how many rows the whole run saves. Because filters run after the fetch, a narrow brand or price band on a broad term reads many pages for few rows. Narrow the term itself first (thinkpad rather than portatil plus brand), or let sort put the cards you want on the first pages.

Step 4: Optional enrichment features

Every field comes from the search card, and no product page is opened. If you need specifications, the url field links each product page.

Step 5: Run the Actor

.call() starts the run and waits for it to finish:

# 3. Start the Actor run and wait for it to finish
print("Starting PcComponentes extraction...")
run = client.actor("reventadata/pccomponentes-scraper").call(run_input=run_input)
if run is None or run.status != "SUCCEEDED":
    status = run.status if run else "unknown"
    raise SystemExit(f"Run did not succeed (status: {status}).")

# 4. Fetch the saved products
items = client.dataset(run.default_dataset_id).list_items().items
print(f"Retrieved {len(items)} products.\n")

Step 6: Examine the results

for item in items:
    print(item["name"])
    print(f"  Brand: {item.get('brand')} | Seller: {item.get('seller')} | Condition: {item.get('condition')}")
    print(f"  Price: {item.get('price')} {item['currency']} | PVPR: {item.get('originalPrice')}")
    print(f"  Discount: {item.get('discountPercentage')}%")
    print(f"  Rating: {item.get('rating')} from {item.get('reviewsCount')} reviews")
    print(f"  {item['url']}")
    print("-" * 40)

A sample, the first of the 37 product cards in a capture dated 2026-11-02 of a PcComponentes Spain results page, parsed with the Actor's own parser for the query portatil. A saved row also carries scrapedAt, added at save time:

{
  "id": "11015791",
  "name": "Portátil Alurin Flex Advance AMD Ryzen 5 7430 15.6\" / 16 GB / 512GB / Windows 11 Home",
  "brand": "Alurin",
  "category": "Portátiles",
  "price": 529.99,
  "originalPrice": 599.99,
  "discountPercentage": 11.7,
  "currency": "EUR",
  "seller": "PcComponentes",
  "condition": "new",
  "mpn": "ALURZ5743016512WH",
  "url": "https://www.pccomponentes.com/portatil-alurin-flex-advance-amd-ryzen-5-7430-15-6-16-gb-512gb-windows-11-home",
  "image": "https://thumb.pccomponentes.com/w-150-150/articles/1101/11015791/1796-portatil-alurin-flex-advance-amd-ryzen-5-7430-156-16-gb-512gb-windows-11-home-comprar.jpg",
  "rating": 4.3,
  "reviewsCount": 143,
  "country": "ES",
  "matchedKeyword": "portatil"
}

Step 7: Export

Apify datasets export as JSON, CSV, XML, Excel, HTML table, RSS or JSONL, from Console or through the API's format parameter. In Python, iterate_items() streams rows for larger datasets.


Working with the API

The Python client gives two ways to start this Apify Actor. client.actor("reventadata/pccomponentes-scraper").call(run_input=run_input) starts the run and waits for it to finish before returning the run object, or None; that is what the code above uses. For long runs or a job queue, .start(run_input=run_input) returns the run object at once, and you read it back later with its ID.

Authentication is the API token in APIFY_API_TOKEN; keep it out of source control. Once a run finishes, client.dataset(run.default_dataset_id).list_items().items returns the rows in one call, and iterate_items() streams them.

For event-driven pipelines, attach a webhook for the ACTOR.RUN.SUCCEEDED event. Its payload's resource carries defaultDatasetId, and your handler can fetch the rows without polling.

Error handling: check run.status as the code does; webhook events cover SUCCEEDED, FAILED and TIMED-OUT runs. A run that saves no rows ends FAILED when a page was blocked or could not be read; a search that loads normally but matches nothing ends SUCCEEDED with an empty dataset and a status message saying so. When a run fails, read its log from Python with client.log(run.id).get(); the summary line, Run finished: pushed N records to dataset., says how many rows were saved, and earlier lines show each page's parsed and kept cards.

Limits: the account's memory and concurrent-run limits apply to every start. call() accepts wait_for_resources, which keeps retrying the start while the account lacks the memory or a free concurrent-run slot.


Advanced usage patterns

Batch processing multiple queries

Pass several terms in searchQueries, for example ["portatil", "monitor", "rtx 4070"]. They run in the order given within one run and fill one dataset. A product kept under one term is not saved again under a later one, and the run stops once maxItems is reached.

Two stores, one pipeline

Spain and Portugal share one card markup, so the same code reads both. Run once with country: "ES" and once with "PT", and key the rows on mpn plus country to compare the same part across the two stores.

Scheduled runs

Save the input as a task (a reusable saved configuration) and add an Apify schedule. Schedules run an Actor or task on a cron expression; 0 8 * * * is every day at 8 AM. A daily sort: "DISCOUNT" run gives you a dated list in the site's discount order ("Mayor descuento") for a search.

Monitoring

Combine the schedule with a webhook on ACTOR.RUN.SUCCEEDED to load each new dataset, and treat a FAILED run as a signal: with this Actor it means a page was blocked or could not be read and no rows were saved. A term that matches nothing or an over-strict filter does not fire ACTOR.RUN.FAILED; check the dataset item count or the status message instead.

Volume control

maxItems and maxPages are the two bounds. Narrow on the site first with the search term and sort, then filter.


Understanding your data

Key fields and how to read them:

  • price: the offer price in euros. currency is EUR on both stores.
  • originalPrice: the PVPR (recommended retail price) or crossed-out price on the card, null when the card shows none.
  • discountPercentage: the discount the card states. When it states none but shows a higher PVPR, the Actor computes it from the two prices: the sample card stated 0, so its 11.7 comes from 529.99 against 599.99. Another card in the capture, the Lenovo ThinkBook 16 G9, stated 5 (848.97 against a PVPR of 896.51).
  • seller: PcComponentes or a marketplace merchant. In the capture, 36 of the 37 cards were sold by PcComponentes and one, the Lenovo ThinkBook 16 G9, by Qk Mobile.
  • condition: new or reconditioned; a card that does not say is recorded as new.
  • mpn: the manufacturer part number, the safest key for matching products across shops.
  • rating, reviewsCount: star score out of 5 and number of opinions (the sample row has 4.3).
  • matchedKeyword, country: which search and store produced the row.

Troubleshooting guide

  • Run FAILED with "0 results for ...": nothing was saved because a page was blocked or could not be read, so matches may have been missed. A search that loads normally but matches nothing ends SUCCEEDED with an empty dataset and a status message; check that the term's words appear in the product names, and loosen price, brand or keyword filters.
  • Input refused before the run starts: country, sort or condition is not one of its listed values, or maxItems / maxPages is outside its range.
  • A product you can see on the site is missing: its name lacks a word of your term. In the capture, 13 of the 37 titles have no "portátil" (the seven Apple MacBook cards, for example), so a portatil search would not save them, while macbook would save the MacBooks.
  • Fewer rows than maxItems: the walk stopped at maxPages, at an empty page, or at a page that kept nothing and held fewer than 5 cards.
  • A query stops early with a warning in the log: the site refused the page twice; that query stops and the next one starts. Run it again later.
  • Reading the log: client.log(run.id).get(); each page logs its URL, its parsed card count and how many rows it kept.

For help, use the Actor's Store page.


Best practices

  1. Narrow on the site first. The search term and sort change what PcComponentes serves; post-fetch filters only drop rows.
  2. Always set maxItems and maxPages. They bound the run.
  3. Start small. maxPages: 1 and maxItems: 5 until your code handles the fields.
  4. Key on mpn. Product names vary; part numbers match across stores and shops.
  5. Mind freshness. Prices and discounts change; schedule reruns instead of reusing old datasets, and keep scrapedAt.
  6. Handle failure explicitly. Check run.status before reading rows, and read the log before trusting a short dataset: each page logs how many cards it parsed and kept.
  7. Search in the site's words. Use the words PcComponentes puts in product titles, since every word of the term must appear in the name.

Pricing

For current pricing and details, see the Store page.


Conclusion and next steps

You configured PcComponentes Scraper, ran it from Python and read typed product rows with prices, PVPR, discounts, sellers and ratings, plus filters that run before a row is saved. Next: switch to the Portuguese store, schedule a daily discount check, or attach a webhook to load each dataset.

Try PcComponentes Scraper yourself and let me know what you build!

About the author: reventadata builds and maintains marketplace and retail scrapers on the Apify Store.


Resources

About the author

  • Hi, I'm the engineer behind ReventaData. I build pay-per-event Apify Actors that turn public marketplace, classifieds, jobs and real-estate sites into clean, reliable datasets. Here on Hashnode, I share practical tutorials on collecting structured web data with Python and Apify, and on putting it to work: price tracking, lead lists and market analysis. Explore our turnkey scrapers: https://apify.com/reventadata

No comments yet. Be the first to comment.