Double Rewards

Rotating IPs:Buy 50GB, get 10GB free

Static IPs:Get 7 extra days for every 30 days purchased, plus 500MB per order

Buy Now >

Security AlertA fraudulent phishing site ( rola-ip.com) is impersonating our previous official website. ROLA IP's only official website is rola-ip.co (make sure it uses the .co domain suffix). To protect your funds, do not make payments on any other domain!

Scrape Indeed Jobs with Python: Extract Job Fields and Export to CSV

Chloe Sun

Nov 30, 2026 · Guides · 11 min read

TL;DR: Use Python and Beautiful Soup to extract job titles, companies, locations, visible salary text, and links from saved Indeed search-page HTML, deduplicate by job ID, and export a CSV. This guide covers listing cards from one page, not pagination or full job descriptions. A separate URL-input mode sends requests through Rola IP and stops if the target rejects the request or returns no matching job cards.

Which Job Information to Extract from Indeed Search Results

Using the job results for the search term marketing in Singapore as an example, the list on the left shows job titles, companies, and locations, along with salary and employment tags for some roles. The details panel on the right displays expanded information for another job. When exporting the list, every field should be read from its corresponding job card; do not apply the right-side details to every result.

Indeed Singapore marketing search results page

The total number of jobs reported for a search and the number of cards in the loaded list are different metrics. Each CSV row represents one parsed card after deduplication by job ID; your export count depends on the cards present in your input HTML.

Prepare the Indeed Page HTML and Python Environment

Start with a saved Indeed search page. In a browser displaying the results, open Developer Tools, select the top-level html element in the Elements panel, and copy its outer HTML. Save that text as UTF-8 in source/indeed_jobs.html inside your project directory. This captures the currently loaded DOM, including rendered cards; it does not collect every result or additional pages.

Before continuing, search the saved file for data-testid="slider_item" and data-jk. The parser below requires job cards with these attributes. If they are absent, check that you copied the results DOM rather than a login or verification page, then inspect the current card structure before changing the selectors. Create the source directory if it does not already exist.

Use Python 3.10 or later. Run the following commands in a Bash-compatible terminal, such as macOS Terminal, Linux, or WSL. If your Python executable is named python, use that name consistently instead of python3:

python3 --version
python3 -m pip install beautifulsoup4==4.15.0 requests
python3 -m pip show beautifulsoup4 requests

The script supports two input methods: reading saved HTML, or requesting a target job-search URL through Rola IP. Start with the file-input mode to check extraction. In URL-input mode, the script requires HTTP 200 before parsing. Both modes write a CSV only when matching job records are found.

How to Locate Fields When You Scrape Indeed Job Postings

In this set of pages, each job card corresponds to [data-testid="slider_item"]. Within a card, a[data-jk][href] provides the job ID, title, and link; company-name and text-location correspond to the company and location. Salary is read from the element containing salary-snippet-container, while employment tags come from attribute_snippet_testid. When a field is missing, keep an empty value instead of borrowing content from an adjacent card.

Marketing Team Member card with salary text

CSV Fields

CSV field Page element Export rule
job_id, title, job_url a[data-jk][href] Keep the job ID and complete the link as an absolute URL
company, location company-name, text-location Remove extra whitespace and retain the original page content
salary_text salary-snippet-container Fill in only when present on the corresponding card; leave blank otherwise
employment_tags attribute_snippet_testid Join multiple tags with semicolons
source_file Input HTML filename or request URL Makes the corresponding page easy to trace

The salary text includes the currency, range, and time unit, so preserve it in full first. If you later need to calculate an annual salary, convert it in a separate cleaning step while retaining the original field for verification. A search card is also not the same as a complete job description; responsibilities, qualifications, and benefits require the corresponding detail page as an additional input.

Complete Indeed Job Scraper Python Code

Write the following code to parse_indeed_jobs.py. Use a file path for saved HTML; use --url to request a target page through Rola IP. The proxy username and password are read from environment variables rather than stored in the script; Python Requests proxy configuration covers authentication and rotation settings. When the target returns a non-200 status or the parser finds no matching jobs, the script stops without writing or updating the output CSV.

"""Extract job cards from an Indeed search-page HTML file."""
from __future__ import annotations

import argparse
import csv
import os
from pathlib import Path
from urllib.parse import quote, urljoin

from bs4 import BeautifulSoup
import requests

FIELDS = (
    "job_id",
    "title",
    "company",
    "location",
    "salary_text",
    "employment_tags",
    "job_url",
    "source_file",
)


def text_from(card, selector: str) -> str:
    node = card.select_one(selector)
    return node.get_text(" ", strip=True) if node else ""


def extract_jobs(html: str, source_file: str, base_url: str) -> list[dict[str, str]]:
    soup = BeautifulSoup(html, "html.parser")
    cards = soup.select('[data-testid="slider_item"]')
    jobs = []

    for card in cards:
        link = card.select_one("a[data-jk][href]")
        if not link or not link.get("data-jk", "").strip():
            continue

        tags = [
            item.get_text(" ", strip=True)
            for item in card.select('li[data-testid="attribute_snippet_testid"]')
        ]

        jobs.append({
            "job_id": link["data-jk"].strip(),
            "title": link.get_text(" ", strip=True),
            "company": text_from(card, '[data-testid="company-name"]'),
            "location": text_from(card, '[data-testid="text-location"]'),
            "salary_text": text_from(card, 'li[data-testid*="salary-snippet-container"]'),
            "employment_tags": "; ".join(tags),
            "job_url": urljoin(base_url, link["href"]),
            "source_file": source_file,
        })

    return jobs


def main() -> None:
    parser = argparse.ArgumentParser()
    parser.add_argument("html_file", nargs="?", type=Path)
    parser.add_argument("--url", help="Authorized Indeed search URL to request through Rola IP")
    parser.add_argument("--output", type=Path, default=Path("indeed_jobs.csv"))
    parser.add_argument("--base-url", default="https://sg.indeed.com/")
    args = parser.parse_args()

    if bool(args.html_file) == bool(args.url):
        parser.error("Provide either an HTML file or --url.")

    if args.url:
        required = ("ROLA_HOST", "ROLA_PORT", "ROLA_USER", "ROLA_PASSWORD")
        missing = [name for name in required if not os.getenv(name)]
        if missing:
            parser.error("Missing environment variables: " + ", ".join(missing))

        proxy = "http://{user}:{password}@{host}:{port}".format(
            user=quote(os.environ["ROLA_USER"], safe=""),
            password=quote(os.environ["ROLA_PASSWORD"], safe=""),
            host=os.environ["ROLA_HOST"], port=os.environ["ROLA_PORT"]
        )

        try:
            response = requests.get(
                args.url,
                proxies={"http": proxy, "https": proxy},
                headers={"User-Agent": "Mozilla/5.0"},
                timeout=30,
                allow_redirects=True,
            )
        except requests.RequestException as exc:
            raise SystemExit(f"Proxy request failed: {type(exc).__name__}; CSV was not written.") from None

        if response.status_code != 200:
            raise SystemExit(f"Target returned HTTP {response.status_code}; CSV was not written.")

        html = response.text
        source_name = response.url
        base_url = response.url
    else:
        html = args.html_file.read_text(encoding="utf-8")
        source_name = args.html_file.name
        base_url = args.base_url

    jobs = extract_jobs(html, source_name, base_url)
    if not jobs:
        raise SystemExit("No job cards found; CSV was not written.")

    unique = list({job["job_id"]: job for job in jobs}.values())

    args.output.parent.mkdir(parents=True, exist_ok=True)
    with args.output.open("w", newline="", encoding="utf-8-sig") as file:
        writer = csv.DictWriter(file, fieldnames=FIELDS)
        writer.writeheader()
        writer.writerows(unique)

    print(f"Source: {source_name}")
    print(f"Cards matched: {len(jobs)}")
    print(f"Unique job IDs: {len(unique)}")
    print(f"Rows with salary: {sum(bool(job['salary_text']) for job in unique)}")
    print(f"CSV: {args.output.resolve()}")

    for job in unique[:5]:
        print(f"  {job['job_id']} | {job['title']} | {job['company']}")


if __name__ == "__main__":
    main()

Run the following command in the project directory:

python3 parse_indeed_jobs.py source/indeed_jobs.html --output indeed_jobs.csv

For a saved page from another Indeed regional domain, pass that page’s original URL with --base-url so relative job links resolve to the correct site.

For URL-input mode, follow the proxy setup section below: obtain your connection parameters, set the environment variables, check the exit, and then run the Indeed request. Use a different output filename for each run if you need to keep previous results; a failed run leaves any existing CSV unchanged.

How to Verify the Exported Indeed Jobs CSV

After running the script, compare its terminal counts with your saved HTML and exported CSV:

  • Cards matched counts cards with a usable job link and nonempty job ID.
  • Unique job IDs counts the exported data rows after deduplication, excluding the CSV header.
  • Rows with salary counts exported records with nonempty salary text.

When the same job_id appears more than once, the script keeps the last matching card’s entire record. It does not merge fields or select the most complete record, so a blank value in a later duplicate can replace a populated value in an earlier one.

The exported CSV uses utf-8-sig encoding and can be opened in Numbers or Excel. Check the header and row count, then compare job titles, companies, locations, and salaries against the corresponding source cards. The counts vary with your input; the screenshot below displays 16 matched records, 16 unique IDs, and 4 salary values.

Terminal output showing 16 cards

For example, the screenshots show Marketing Communications & PR Manager at Sony Electronics (Singapore) Pte. Ltd. and a Marketing Team Member card displaying $3,900 - $5,000 a month. Check equivalent fields within each corresponding card in your own input, rather than borrowing values from the details panel on the right.

CSV list in Numbers

If you continue processing multiple pages, first record each page’s search term, region, and date, then merge the CSVs and deduplicate by job_id. If two jobs have similar titles but different job_id values, retain both records first and check the original cards.

Why the Parser Returns Zero Rows or Empty Salaries

  • Zero rows: First open the input page and confirm that job cards actually exist. Then check whether [data-testid="slider_item"] and a[data-jk] are still present. Login pages, verification pages, and error pages must not be treated as empty search results. The program above ends immediately when no jobs are extracted and does not write an apparently successful empty CSV.
  • Empty salary: Check whether the corresponding card displays a salary. If it does, inspect the saved HTML and salary selector. If it does not, leave salary_text empty; an empty value does not mean the salary is zero.
  • Different job counts: The total search count on the page is an indicator for the entire query scope; the CSV row count depends on the cards that can be parsed from the current input. Do not confuse these two numbers as the actual export count.
  • Broken job links: Some job_url values contain redirect parameters and may change later. When verifying records, retain the job_id, job title, and source-page information as well.

How to Configure Rola IP and Request an Indeed Page

Follow the target website’s Terms of Service, robots.txt rules, and applicable access requirements when making automated requests. Indeed’s Terms of Service restrict automated access without express written permission, subject to the conditional crawling permission described in its robots.txt.

Our residential proxies at Rola IP support country targeting and session controls. First obtain the HOST, PORT, username, and password from our console; the Rola IP Quick Start guide lists these parameters. Use the username settings for your selected country and session policy when configuring the connection.

Rola IP console connection parameters

In the same Bash-compatible terminal you will use to run Python, replace the placeholders with your connection parameters and set the four environment variables. Then query the exit IP through the proxy. Keep account passwords out of published screenshots:

export ROLA_HOST='your-host'
export ROLA_PORT='your-port'
export ROLA_USER='your-user'
export ROLA_PASSWORD='your-password'

curl --max-time 20 --proxy "http://$ROLA_HOST:$ROLA_PORT" --proxy-user "$ROLA_USER:$ROLA_PASSWORD" -w '\nHTTP %{http_code}\n' 'https://ipinfo.io/json'

Check the returned ip and country fields against your selected exit. In the example below, FR identifies the French exit and HTTP 200 confirms that the lookup request succeeded. This checks the proxy exit; job extraction is checked separately against the target page and exported CSV.

Rola IP proxy exit verification showing country FR and HTTP 200

After checking the exit response, run the Indeed request in that same terminal:

python3 parse_indeed_jobs.py --url 'https://sg.indeed.com/jobs?q=marketing&l=Singapore' --output indeed_jobs_via_rola.csv

A successful run returns matching job cards and writes the CSV. A rejected response stops the script before export. The script makes one request and does not retry automatically. Use these checks when the request fails:

  • 407 Proxy Authentication Required: Check the proxy host, port, username, password, and the account’s authentication settings. For an HTTPS destination, a proxy’s 407 response to the CONNECT request may appear as a ProxyError instead of Target returned HTTP 407.
  • 403 Forbidden: Inspect the response body and the request context. A residential IP alone does not determine whether the target accepts a request: headers, cookies, session consistency, request frequency, and TLS client characteristics can also matter. The example sends a basic User-Agent; for a fuller client implementation, use headers appropriate to the request, maintain cookies across related requests, and reduce concurrency and request frequency. Adding browser header names does not reproduce a browser’s TLS fingerprint or guarantee that a 403 will disappear.
  • 429 Too Many Requests: Stop further requests. Honor Retry-After when present, whether it specifies a delay in seconds or an HTTP date, and reduce the request rate before resuming. The script exits on 429; it does not wait and retry for you.
  • Timeout: Check whether the exit-IP query succeeds, then check connectivity to the target and whether it is responding slowly. The Python request uses a 30-second timeout setting; investigate the connection before repeating the request.

Use a sticky session with our residential proxies to maintain the same exit IP within the configured session period. For workflows that need a fixed IP across sessions, choose our Static Residential ISP Proxies.

Conclusion

To scrape Indeed jobs into a usable CSV, start with the saved search-page HTML, extract fields within each card, and deduplicate by job ID. Compare the exported rows with the source cards, preserving missing salaries as empty values and keeping the original salary text. Use our separate proxy request mode to integrate Rola IP into the page-retrieval step.

FAQs