Aller au contenu
Toutes les missions
Veille marché · Dev-to Nouvelle Publiée il y a 18 heures

How to Pull JobStreet Malaysia Job Listings into Python with JobStreet Malaysia Scraper

A job board shows a few dozen listings for one keyword, one card at a time. To keep the title, employer, location and posting time of each listing in a spreadsheet you copy them by hand. Thi...

Mode Sur site

Résumé

A job board shows a few dozen listings for one keyword, one card at a time. To keep the title, employer, location and posting time of each listing in a spreadsheet you copy them by hand. This tutorial replaces that with a short Python script. It runs one job keyword on JobStreet Malaysia and returns one row per job card. The tool is the JobStreet Malaysia Scraper Actor (reventadata/jobstreet-scraper). You call it from Python with the official apify-client package. The Actor reads public pages and needs no login. It is not affiliated with JobStreet Malaysia. By the end you will have a script that runs one search, saves the rows to a JSON file and turns them into a CSV file. Prerequisites Python 3.11 or newer. The Apify API client for Python: pip install -U "apify-client~=3.0" An Apify account and your personal API token, set as an environment variable: export APIFY_API_TOKEN="your_apify_token_here" The Actor needs no login. The token is only for the call from your script. What you'll achieve Each row is one job card of the JobStreet Malaysia public job search. The fields are: id: the public job identifier. title: the job title as published on the card. url: the public job page URL. company: the employer published on the card. It can be empty. location: the location published on the card. It can be empty. jobType: the employment type published on the card. It can be empty. postedAt: the posting time as the card words it, a text value. It can be empty. description: the short description published on the card. It can be empty. matchedQuery: the keyword you searched. scrapedAt: an ISO 8601 timestamp of when the row was stored. Example use case: search a keyword such as software engineer, keep the title, employer and location of each job in a file, then run the same search another day and compare the id values of the two files to see which jobs are in only one of them. Step 1: Open the Actor Open the JobStreet Malaysia Scraper page on the Apify Store to read its description. This guide calls the Actor from Python, so the ID you need is reventadata/jobstreet-scraper. Step 2: Set the inputs Field Type What it does query string Required. A public job keyword, for example software engineer. maxItems integer Maximum number of results to store in the dataset. Minimum 1. Default 25. query decides what is searched. maxItems decides when the Actor stops saving rows. A small value such as 10 is a good first test, because you can read every row. Step 3: Run it from Python import json import os from apify_client import ApifyClient client = ApifyClient(os.environ["APIFY_API_TOKEN"]) run_input = {"query": "software engineer", "maxItems": 10} run = client.actor("reventadata/jobstreet-scraper").call(run_input=run_input) if run is None: raise SystemExit("The run did not start.") print("Run status:", run.status) items = client.dataset(run.default_dataset_id).list_items().items for item in items: print(item["title"], "|", item.get("company"), "|", item.get("location"), "|", item.get("postedAt"), "|", item["url"]) with open("jobstreet-software-engineer-rows.json", "w", encoding="utf-8") as f: json.dump(items, f, indent=2, ensure_ascii=False) The call method starts the Actor and waits for it to finish. The run object has a status and the ID of the dataset that stores the rows. list_items().items returns the rows as a list of dictionaries. The loop prints one line per job and the last lines save every row to jobstreet-software-engineer-rows.json. If the run did not start, call returns nothing, and the script stops with a message instead of failing later on an empty value. The loop reads company, location and postedAt with get because a row can have them empty. Step 4: Read the rows The three rows below are the first three of the example run of 2026-11-27 (input {"query": "software engineer", "maxItems": 10}, 10 rows in total). They are shown whole and unedited. [ { "id": "96083213", "title": "Software Engineer", "url": "https://my.jobstreet.com/job/96083213", "company": "Leading Innovative Technologies and Systems", "location": "Shah Alam, Selangor", "jobType": "Full time", "postedAt": "three days ago", "description": "If you enjoy solving problems, trying new tech, and building cool, practical solutions that people actually use every day, this role is for you!", "matchedQuery": "software engineer", "scrapedAt": "2026-11-27T17:18:20.203566+00:00" }, { "id": "96049324", "title": "Software Engineer (Full-Stack, AI-Assisted Development)", "url": "https://my.jobstreet.com/job/96049324", "company": "Ekomas Technologies Sdn Bhd", "location": "Alam Damai, Kuala Lumpur", "jobType": "Full time", "postedAt": "four days ago", "description": "Build real client web apps with an AI-first workflow at a US-headquartered software company. Fresh graduates welcome. Office-based in Alam Damai, KL.", "matchedQuery": "software engineer", "scrapedAt": "2026-11-27T17:18:20.203566+00:00" }, { "id": "95667394", "title": "Junior Software Engineer", "url": "https://my.jobstreet.com/job/95667394", "company": "Tokio Marine Insurans (Malaysia) Berhad", "location": "Kuala Lumpur City Centre, Kuala Lumpur", "jobType": "Full time", "postedAt": "twenty four days ago", "description": "Design, development, testing, and deployment of software & application to meet business objective under organization’s IT projects & initiatives.", "matchedQuery": "software engineer", "scrapedAt": "2026-11-27T17:18:20.203566+00:00" } ] Notes on the fields: postedAt is text exactly as the card words it, such as three days ago or twenty four days ago. It is not a date. Keep scrapedAt next to it, because a phrase like three days ago only means something relative to the day the row was stored. description is the short text shown on the card, not the full job advert. Open url for the full page. matchedQuery repeats the keyword you searched. scrapedAt is a UTC timestamp. Every row of one run carries the same value in the example above. id identifies the job, and url links to its public page. The schema allows company, location, jobType, postedAt and description to be empty (null). All three example rows have them filled, so read them with item.get("name") anyway. Understanding your results A row is a copy of what the site shows on one job card: a title, an employer, a location, a job type, a posting time and a short description. Nothing in the row is calculated by the Actor. That has two consequences. First, postedAt is a string in the site's own wording. If you want to sort jobs by age, parse that text yourself and decide how to treat phrases that have another shape. A simple approach is to keep the original text in one column and add a second column with your own estimate, so you can always see what the site published next to what your code made of it. Second, a row only holds what the card published. Code that must not stop on a missing value should read the optional fields with item.get("name"). Pro tips and advanced usage Save a CSV. The second script reads the JSON file back and writes a CSV with the columns you choose: import csv import json with open("jobstreet-software-engineer-rows.json", encoding="utf-8") as f: items = json.load(f) columns = ["id", "title", "company", "location", "jobType", "postedAt", "description", "matchedQuery", "scrapedAt", "url"] with open("jobstreet-software-engineer-rows.csv", "w", newline="", encoding="utf-8") as f: writer = csv.DictWriter(f, fieldnames=columns) writer.writeheader() for item in items: writer.writerow({name: item.get(name) for name in columns}) Keep one file per day. Put the date in the file name and compare files later with scrapedAt. Try several keywords. Run the script once per keyword. matchedQuery tells you which keyword produced each row when you merge the files. Start small. Keep maxItems low until the first rows look right, then raise it. Check a link by hand. Open a few url values in a browser and compare the title and the employer with the row, now and then. Dedupe on id. A job can appear under two keywords when you merge files, so key merged data by id. Limits to know One keyword is read per run, and only the first public results page is read. A run reads up to 30 job cards (measured on 2026-11-27). maxItems defaults to 25, so a run that leaves it out stores at most 25 rows. Set it to 30 to keep a full page. A keyword with no matching results stores no rows. query is required and must be 1 to 100 characters: ASCII letters, digits, spaces and the characters _ - . , & + %. Only fields the site publishes are returned. Nothing sits behind a login. The same id is stored once per run. Troubleshooting common issues The run stops with a message and no rows: check that query is not empty, is 1 to 100 characters and uses only the characters listed above, and that maxItems is at least 1. The run succeeds with no rows: the keyword had no matching results. Try a broader keyword. The run fails with a message about the site: the site refused the run or its page could not be read. Wait and run it again. The run log shows the message the Actor wrote. A row shows an empty field: the site did not publish it. Read it with item.get("name") as shown above. The status is not a success: read the run log in the Apify Console. The Actor writes the reason there. Next steps Run the script on a schedule with your own cron job or a scheduler, keep the files, and compare them across dates. Try other keywords and a larger maxItems. The Apify Python client documentation covers the rest of the client. For current pricing and details, see the Store page. About the author: reventadata builds and publishes data extraction Actors on the Apify Store.