DEV Community

Cover image for How to Pull Mexican Job Listings from OCC Mundial with Python
ReventaData
ReventaData

Posted on Originally published at apify.com

How to Pull Mexican Job Listings from OCC Mundial with Python

By the end of this tutorial you will have a short Python script that pulls job listings from OCC Mundial, the Mexican job board, into structured rows. Each row holds the job title, the company, the location, the salary text, the posting age and the link to the listing. You do not need to write any scraping code yourself.

OCC Mundial Scraper (reventadata/occ-mundial-scraper) is the Apify Actor built for this site. You give it a keyword, such as python, and it returns one row per listing. This guide calls it from Python with the Apify client. The Actor is not affiliated with OCC Mundial. It reads public search pages without a login.


Prerequisites

You need three things: Python 3 with the Apify client installed, a free Apify account, and your Apify API token from that account. Install the client and export the token:

pip install -U "apify-client~=3.0"
export APIFY_API_TOKEN="your_apify_token_here"
Enter fullscreen mode Exit fullscreen mode

No browser automation is needed on your side. The Actor reads the public pages for you.


What you'll achieve

You will search OCC Mundial for python, read the rows in Python and print three lines per listing. The first line holds the title, the company and the location. The second holds the salary text and the posting age. The third holds the link to the listing. Because every row has the same fields, you can sort the output by company or location afterwards, or paste it into a spreadsheet. Each row also carries a link, so every line can be opened in one click.

To search for another keyword, change one value in the script and nothing else. Step 2 lists the two inputs that exist.


Step 1: Open OCC Mundial Scraper

Open the OCC Mundial Scraper page on Apify Store. This tutorial calls the Actor from Python, so the name reventadata/occ-mundial-scraper is all you need from that page.


Step 2: Choose the search

The Actor takes two input fields:

  • query (required): the job keyword, in Spanish, for example python. It can be up to 120 characters.
  • maxItems: the most rows to store. Left unset, it defaults to 25. It must be at least 1.

The sample input below is the one used for the example run in this guide:

{"query": "python", "maxItems": 10}
Enter fullscreen mode Exit fullscreen mode

Step 3: Run it from Python

This script starts the Actor, waits for it to finish, reads the dataset and prints three lines per listing:

import os
from apify_client import ApifyClient

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

# 2. Describe the search: "python", at most 10 rows
run_input = {"query": "python", "maxItems": 10}

# 3. Start the Actor and wait for it to finish
run = client.actor("reventadata/occ-mundial-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. Read the rows from the run's default dataset
items = client.dataset(run.default_dataset_id).list_items().items
print(f"Retrieved {len(items)} job listings.\n")

# 5. Print three lines per listing
for item in items:
    print(f"{item['title']} at {item['company']}, {item['location']}")
    print(f"  salary: {item.get('salary') or 'not stated'}, posted: {item.get('posted')}")
    print(f"  {item['url']}")
Enter fullscreen mode Exit fullscreen mode

The script has five parts. It creates the client from the token in the environment. It describes the search as a dictionary, run_input. It starts the Actor with .call(...), which waits until the run has finished and returns the run. It stops with a message unless run.status is SUCCEEDED. Then it reads the rows from the run's default dataset, run.default_dataset_id, and prints three lines per listing. To search for something else, change the keyword in run_input.


Step 4: Read the output

The example run of 2026-11-27 used {"query": "python", "maxItems": 10} and returned 10 rows. The first 3 are shown whole and unedited, except that the dollar sign inside each salary text is written as the JSON escape \u0024, which any JSON parser reads back as the same character.

[
  {
    "id": "21353357",
    "title": "Desarrollador python",
    "url": "https://www.occ.com.mx/empleo/oferta/21353357",
    "company": "Sipaba",
    "location": "Zapopan, Jalisco",
    "salary": "\u0024 20,000 - \u0024 23,000 Mensual",
    "posted": "Hace 2 meses",
    "matchedQuery": "python",
    "scrapedAt": "2026-11-27T15:34:47.465186+00:00"
  },
  {
    "id": "21353241",
    "title": "Ingeniero Backend Senior Python e IA (FastAPI, Google Cloud, LLMs)",
    "url": "https://www.occ.com.mx/empleo/oferta/21353241",
    "company": "WEBCARE",
    "location": "Ciudad de México",
    "salary": "\u0024 25,000 - \u0024 35,000 Mensual",
    "posted": "Hace 2 meses",
    "matchedQuery": "python",
    "scrapedAt": "2026-11-27T15:34:47.465186+00:00"
  },
  {
    "id": "21432815",
    "title": "Desarrollador python",
    "url": "https://www.occ.com.mx/empleo/oferta/21432815",
    "company": "Branchbit",
    "location": "Coyoacán, Ciudad de México",
    "salary": "\u0024 25,000 - \u0024 30,000 Mensual",
    "posted": "Hace 4 días",
    "matchedQuery": "python",
    "scrapedAt": "2026-11-27T15:34:47.465186+00:00"
  }
]
Enter fullscreen mode Exit fullscreen mode

Read a row from top to bottom. The id is the listing's number on the site, and url is the link to that listing. title, company and location are the card text. salary is the salary text as the card shows it, kept as a string, so the range and the period (Mensual here) stay together. posted is the posting age as the card words it, in Spanish (Hace 2 meses, Hace 4 días). matchedQuery is the phrase that produced the row, and scrapedAt is the time the row was stored.


Understanding your results

These are the fields every row can hold:

  • id: the listing's number on the site. The same number ends the url.
  • title, company, location: the job title, the company and the place, as the card shows them.
  • url: the link to the listing on OCC Mundial. Use it to open the listing or to store a reference.
  • salary: the salary text as the card shows it, range and period together, or the card's own text when the company hides the pay, for example Sueldo no mostrado por la empresa.
  • posted: the posting age as the card words it, in Spanish, such as Hace 4 días.
  • matchedQuery: the phrase that produced the row. It is the same on every row of one run.
  • scrapedAt: an ISO 8601 timestamp of when the row was stored.

The dataset schema allows an empty value in every card field, so the script uses item.get('salary') or 'not stated' for the salary line. The salary field is text, not a number, so if you want to sort by salary you have to parse that text yourself. Each public result page holds 22 job listings, and the Actor reads further pages until maxItems is reached. A listing that appears twice is stored once, by its id. A phrase with no matching listings stores no rows. Only the fields on the result cards are returned, so there is no full job description, and nothing from behind a login.


Pro tips and advanced usage

  • Start small. Set maxItems to 10 while you check the output shape. Raise it when the rows look right.
  • Use a Spanish keyword. The site is Mexican, and the README describes query as a job keyword in Spanish.
  • Run one search per keyword. The Actor takes one query per run. To cover several keywords, call it in a loop and merge the lists; matchedQuery tells you which phrase produced each row.
  • Remove duplicates by id. A listing that two searches both return has the same id in both.
  • Check posted. The first sample row says Hace 2 meses, so do not assume a listing is fresh.
  • Keep the link. The url identifies each listing, so a later run can show which listings are new compared with an earlier one.

Troubleshooting common issues

  • The run did not succeed. Open the run in the Apify Console and read its log. The script prints the run status and stops, so you never read an empty dataset by mistake.
  • No rows came back. A phrase with no matching listings stores no rows. Try a broader keyword, in Spanish.
  • The run stops at once with an input message. query is required, and it can be up to 120 characters. maxItems must be at least 1.
  • The salary line says "not stated". That line appears only when the salary value is truly empty. When a company hides the pay, the field holds the card's own text, for example Sueldo no mostrado por la empresa, and the script prints that text. The Actor copies what the card shows and adds nothing.
  • Your question is not answered here. Ask in the comments below, and include the input you used and the url of one row.

Next steps

Once the script prints the right rows, save them. Export the run's dataset as CSV or Excel, write the rows to a file from your script, or send them to a database. The id field identifies each listing, so use it to match rows across two runs.

For current pricing and details, see the Store page. Try a keyword of your own, and tell us in the comments which one you searched first.

About the author: reventadata builds and publishes data extraction Actors on the Apify Store.

Top comments (0)