Build a job listings scraper: list pages, JobPosting JSON and dedupe by URL

Build a job listings scraper that returns structured JSON: job URLs from list pages, JobPosting fields and ISO dates from each job page, and dedupe by URL.

Published
Reading time
8 min read
By
ExtractHub team
  • job listings
  • pipelines
  • JSON-LD
  • web scraping
  • tutorial
On this page

Job boards are one of the most common scraping targets, and one of the easiest to get subtly wrong. A job listings scraper has to collect the posting links from search or category pages, read each posting’s details, turn “Posted 3 days ago” into a date you can sort by, and avoid storing the same job five times because it appeared on five list pages.

This post builds that with two ExtractHub extractors chained in a pipeline: a list extractor that outputs clean, deduplicated job URLs, and a detail extractor that reads the schema.org JobPosting block of each job page. Then it covers dates, duplicates across runs and what the fan-out costs. The site in the examples is an illustrative example on example.com; the selectors and paths are not taken from a real job board.

How a job listings scraper is structured

A job board has two page types, and each one gets its own extractor:

search / category page ──> list extractor ──jobUrls──> job page ──> detail extractor ──> dataset

The list page gives you links and little else: a title, a company name, maybe a relative date. The job page has the data that matters, the full description, employment type, location, salary and the closing date. Keeping the two extractors separate means each one has its own versions and health checks, and a redesign of the job page is one patch release of the detail extractor.

The general mechanics of chaining two extractors (url_output_field, relative links, url_template, the fan-out estimate) are covered in scrape a list page, then every detail page. Here we focus on what is specific to job listings.

Step 1: a list extractor that outputs clean job URLs

Job links are rarely clean. The same posting is often linked from a card title, an “Apply” button and a “featured” strip at the top of the page, and the links carry tracking parameters such as ?ref=search or utm_source. If those go straight into the next step, each variant is a separate URL, a separate detail call and a separate charge.

So the list extractor outputs a plain array of strings and cleans it in the transform chain:

{
  "sourceType": "html",
  "fields": [
    {
      "name": "jobUrls",
      "selector": "main [data-testid=\"job-card\"] a[href*=\"/jobs/\"]",
      "isArray": true,
      "extract": "attributeValue",
      "attributeName": "href",
      "transforms": ["toAbsoluteUrl", { "removeQueryParams": ["utm_*", "ref"] }, "unique"]
    },
    {
      "name": "nextPageUrl",
      "selector": "nav[aria-label=\"Pagination\"] a[rel=\"next\"]",
      "extract": "attributeValue",
      "attributeName": "href",
      "transforms": ["toAbsoluteUrl"]
    }
  ]
}

The order of the transforms matters. On an isArray field, value transforms run on each element and the chain switches to the whole array at the first array transform. Here that means:

  1. toAbsoluteUrl resolves /jobs/123-backend-engineer against the page URL.
  2. removeQueryParams drops utm_* (the * at the end is a prefix match) and ref, and drops the ? when nothing is left. A #fragment is kept, so do not link to an anchor if you can avoid it.
  3. unique removes exact duplicates from the array.

unique compares exact strings, which is why it comes last. Put it first and https://www.example.com/jobs/123?ref=featured and https://www.example.com/jobs/123 would both survive.

Required or not on the list

Marking jobUrls as required: true makes a broken selector fail loudly with required_fields_missing instead of returning an empty list. The catch on job boards: a search with no results is a valid empty page, and a required field turns it into a failed, charged call. Mark it required when your start URLs always have results (a category page of a large board), leave it optional for user-entered searches. The trade-off is explained in detail in required fields in web scraping.

Step 2: read the JobPosting block on each job page

Most job pages publish a schema.org JobPosting block in JSON-LD, because search engines use it for job listings. That block has the fields you want under stable, documented keys: title, datePosted, validThrough, employmentType, hiringOrganization, jobLocation, baseSalary, description. Reading it is more stable than reading the rendered markup, as explained in scrape embedded JSON.

A job page often has several JSON-LD blocks: a BreadcrumbList, an Organization, then the JobPosting. The single jsonPath form handles that: with several matched scripts, a field uses the first one whose JSON parses and gives a non-empty value at its path. So each field finds the JobPosting block without you knowing its position:

{
  "sourceType": "html",
  "fields": [
    { "name": "title", "selector": "script[type=\"application/ld+json\"]", "extract": "jsonContent", "jsonPath": "title", "required": true },
    { "name": "company", "selector": "script[type=\"application/ld+json\"]", "extract": "jsonContent", "jsonPath": "hiringOrganization.name" },
    { "name": "datePosted", "selector": "script[type=\"application/ld+json\"]", "extract": "jsonContent", "jsonPath": "datePosted" },
    { "name": "validThrough", "selector": "script[type=\"application/ld+json\"]", "extract": "jsonContent", "jsonPath": "validThrough" },
    { "name": "employmentType", "selector": "script[type=\"application/ld+json\"]", "extract": "jsonContent", "jsonPath": "employmentType" },
    { "name": "city", "selector": "script[type=\"application/ld+json\"]", "extract": "jsonContent", "jsonPath": "jobLocation.address.addressLocality" },
    { "name": "description", "selector": "script[type=\"application/ld+json\"]", "extract": "jsonContent", "jsonPath": "description", "transforms": ["toMarkdown"] },
    { "name": "canonicalUrl", "selector": "link[rel=\"canonical\"]", "extract": "attributeValue", "attributeName": "href", "transforms": ["toAbsoluteUrl"] }
  ]
}

A few things to check against your saved sample page before you release it:

  • jobLocation may be an array. Postings with several offices publish a list; then the path is jobLocation[0].address.addressLocality, or jobLocation[*].address.addressLocality for every city.
  • employmentType may be a string or an array ("FULL_TIME" or ["FULL_TIME", "CONTRACTOR"]). The JSON engine returns the value with its JSON type, so your code should accept both.
  • description is HTML. toMarkdown turns it into Markdown. Some sites entity-encode it (&lt;p&gt; instead of <p>); if your sample shows that, put decodeHtml in front: ["decodeHtml", "toMarkdown"].
  • title is required. A job page that comes back without it (a login wall, an “this job has expired” page, a block page) fails with required_fields_missing instead of filling your dataset with empty rows. In a pipeline step a target-side failure like this is retried once inside the step.

The canonicalUrl field reads <link rel="canonical">, which is what you will deduplicate on later.

Because JSON-LD is part of the server-rendered HTML, this extractor does not need JavaScript rendering. That keeps the detail step, the one that runs once per job, on a cheaper fetch tier. If the job board only builds its pages in the browser, you need JavaScript rendering for the detail extractor.

When there is no JobPosting block

Some boards skip structured data. Then read the HTML, and prefer machine-readable attributes over display text. For dates that means the datetime attribute of a <time> element:

{ "name": "datePosted", "selector": "article time[datetime]", "extract": "attributeValue", "attributeName": "datetime" }

That gives 2026-11-27 or a full ISO timestamp where the page shows “3 days ago”. If the page has only the relative text, there is no transform that turns it into a date. Store the text as it is and compute the date in your own code from the time of the run: the pipeline dataset carries a completedAt timestamp for that.

Step 3: chain the two extractors

Release both extractors and pin them, for example @you/example-jobs-list@1 and @you/example-job@1. The pipeline input for the create_pipeline MCP tool:

{
  "name": "Example board: backend jobs",
  "input_urls": [
    "https://www.example.com/jobs?q=backend&page=1",
    "https://www.example.com/jobs?q=backend&page=2",
    "https://www.example.com/jobs?q=backend&page=3"
  ],
  "steps": [
    { "extractor_id": "@you/example-jobs-list@1", "url_output_field": "jobUrls" },
    { "extractor_id": "@you/example-job@1" }
  ],
  "output": { "format": "json" },
  "limits": { "maxCostPerRun": 1 }
}

Search pages with a page parameter are predictable, so pass them as start URLs (up to 100 per run). A chain has no loops, so the list step cannot follow nextPageUrl by itself; for boards with unpredictable next links, run the first page and start the next run from the nextPageUrl you saved with include_in_output: true on the list step.

Validate first with validate_pipeline (free, test keys work, nothing is saved). It checks that jobUrls exists in the list extractor’s output schema and returns an estimate. That estimate counts one call per step per start URL; the realistic cost per list page is one list call plus one detail call per job link on it. Count the links on a sample page, set maxCostPerRun to cover one run with a margin, and look up the tier prices on the pricing section.

Duplicates across pages and runs

The unique transform only sees one list page. The pipeline itself does not remove duplicates between pages: if a posting appears on page 1 and page 2 of a search (boards re-sort while you scrape, and promoted jobs repeat on every page), its URL reaches the detail step twice, runs twice and is charged twice. A step also runs at most 1000 URLs per run; beyond that the rest are dropped with a fan_out_truncated warning, so many duplicates can push real jobs out of a large run.

Two practical defences:

  • Fewer overlapping start URLs. A narrower search or a category page per run overlaps less than many pages of one broad search.
  • Deduplicate where you store the jobs. That is the place that sees every run anyway.

The full dataset (the signed download_url from get_pipeline_job) is JSON with one array per step under results; each record has the targetUrl it was scraped from and the extracted fields. A small Node.js script that upserts jobs by canonical URL:

type JobRecord = { targetUrl: string; extracted: Record<string, unknown> };

const dataset = await (await fetch(downloadUrl)).json();
const scrapedAt = dataset.completedAt as string;

for (const records of Object.values(dataset.results) as JobRecord[][]) {
  for (const { targetUrl, extracted } of records) {
    const key = (extracted.canonicalUrl as string | null) ?? targetUrl;
    await upsertJob(key, { ...extracted, lastSeenAt: scrapedAt });
  }
}

upsertJob is your own storage: insert the job with a firstSeenAt the first time, update lastSeenAt on every later run. That gives you the two facts job data is usually wanted for, when a posting appeared and when it disappeared. A job whose lastSeenAt stops moving, or whose validThrough is in the past, is closed. The same first-seen / last-seen pattern is the usual basis for change detection.

If the JobPosting block has an identifier (usually an object with a value, read with the path identifier.value), it is an even better key than the URL: it survives a changed slug in the job’s title. Add it as one more field and use it first when it is filled.

Run it daily

Run the pipeline on one or two start URLs first, with your OK on the cost, and check the records: every title filled, dates in ISO format, no repeated canonical URLs inside one run. When the records look right, the same pipeline takes a cron schedule and a webhook when each run finishes; a schedule stays off until it is explicitly turned on. Scheduled web scraping walks through the cron, timezone and webhook part.

You can also hand the whole job to an agent. With the MCP server connected and the pipeline builder skill installed in Claude Code:

git clone https://github.com/extracthub-io/extracthub-pipeline-builder ~/.claude/skills/extracthub-pipeline-builder

ask for “every backend job on this board, with the posting date and description, one record per job”. The agent looks for existing extractors in the public catalog, builds the missing ones, takes url_output_field from the list extractor’s output schema, validates the chain and tells you the fan-out cost before the first run.

FAQ

How do I scrape job postings with the posting date as a real date?

Read a machine-readable value instead of the display text. Most job pages carry a schema.org JobPosting block whose datePosted is an ISO 8601 date, and many list pages put the date in a time element's datetime attribute. Text such as "3 days ago" has no transform that turns it into a date, so keep it as text and compute the date from the run's completion time.

How do I avoid duplicate job listings when scraping?

A pipeline does not remove them: every URL the list step outputs runs the detail step once and is charged once. Remove duplicates inside one list page with the unique transform after normalising the links, and deduplicate across pages and runs in your own store, keyed by canonical URL or job id.

Should I scrape the job list page or every job page?

List pages usually show only the title, company, location and a short date. The description, employment type, salary and closing date are on the job page, so a two-step pipeline (list extractor, then detail extractor) is the usual design.

How many job pages can I scrape in one run?

A step runs at most 1000 URLs per run; more are dropped with a fan_out_truncated warning. A chain takes up to 100 start URLs per run, so pass several list pages as start URLs and keep each run under the cap.

All posts