Skip to main content

A Python package for scraping job postings from Indeed and LinkedIn

Project description

Job Scraper 🚀

A powerful and easy-to-use Python package for scraping job postings from Indeed and LinkedIn using Selenium browser automation.

Features ✨

  • 🔍 Scrape job details from Indeed and LinkedIn
  • 🤖 Automatic platform detection
  • 📊 Extract title, company, location, and full job description
  • 🎯 Simple and intuitive API
  • 🛡️ Bypasses anti-bot protection using Selenium
  • ⚙️ Configurable options (headless mode, verbose output)

Installation 📦

Install from source

# Clone or download the repository
git clone https://github.com/yourusername/job-scraper.git
cd job-scraper

# Install the package
pip install .

Install in development mode

pip install -e .

Quick Start 🚀

Basic Usage

from job_scraper import scrape_job

# Scrape any supported job posting (auto-detects platform)
job = scrape_job('https://in.indeed.com/viewjob?jk=...')

if job:
    print(f"Title: {job['title']}")
    print(f"Company: {job['company']}")
    print(f"Location: {job['location']}")
    print(f"Description: {job['description'][:200]}...")

Platform-Specific Scraping

from job_scraper import scrape_indeed_job, scrape_linkedin_job

# Scrape from Indeed
indeed_job = scrape_indeed_job('https://in.indeed.com/viewjob?jk=...')

# Scrape from LinkedIn
linkedin_job = scrape_linkedin_job('https://www.linkedin.com/jobs/view/...')

Advanced Options

from job_scraper import scrape_job

# Run in non-headless mode (show browser window)
job = scrape_job(url, headless=False)

# Disable verbose output (silent mode)
job = scrape_job(url, verbose=False)

# Combine options
job = scrape_job(url, headless=False, verbose=False)

API Reference 📚

scrape_job(url, headless=True, verbose=True)

Automatically detect and scrape jobs from Indeed or LinkedIn.

Parameters:

  • url (str): The job posting URL (Indeed or LinkedIn)
  • headless (bool): Run browser in headless mode (default: True)
  • verbose (bool): Print progress messages (default: True)

Returns:

  • dict: Job details or None if scraping fails

Example:

job = scrape_job('https://in.indeed.com/viewjob?jk=123456')

scrape_indeed_job(url, headless=True, verbose=True)

Scrape a single Indeed job posting.

Parameters:

  • Same as scrape_job()

Returns:

  • dict: Job details with keys: title, company, location, description, source, url

scrape_linkedin_job(url, headless=True, verbose=True)

Scrape a single LinkedIn job posting.

Parameters:

  • Same as scrape_job()

Returns:

  • dict: Job details with keys: title, company, location, description, source, url

Response Format 📋

All scraping functions return a dictionary with the following structure:

{
    'title': 'Senior Python Developer',
    'company': 'Tech Company Inc.',
    'location': 'San Francisco, CA',
    'description': 'Full job description text...',
    'source': 'Indeed',  # or 'LinkedIn'
    'url': 'https://...'
}

Examples 💡

Scrape Multiple Jobs

from job_scraper import scrape_job

urls = [
    'https://in.indeed.com/viewjob?jk=123',
    'https://www.linkedin.com/jobs/view/456',
    'https://in.indeed.com/viewjob?jk=789'
]

jobs = []
for url in urls:
    job = scrape_job(url, verbose=False)
    if job:
        jobs.append(job)
        print(f"✓ Scraped: {job['title']}")

print(f"\nTotal jobs scraped: {len(jobs)}")

Save to JSON

import json
from job_scraper import scrape_job

job = scrape_job('https://in.indeed.com/viewjob?jk=...')

if job:
    with open('job_data.json', 'w', encoding='utf-8') as f:
        json.dump(job, f, indent=2, ensure_ascii=False)
    print("Job saved to job_data.json")

Filter by Keywords

from job_scraper import scrape_job

keywords = ['python', 'django', 'flask']

job = scrape_job('https://in.indeed.com/viewjob?jk=...')

if job and any(keyword.lower() in job['description'].lower() for keyword in keywords):
    print(f"✓ Job matches keywords: {job['title']}")
else:
    print("✗ Job doesn't match keywords")

Requirements 🛠️

  • Python 3.7+
  • selenium >= 4.0.0
  • beautifulsoup4 >= 4.9.0
  • webdriver-manager >= 4.0.0
  • Google Chrome (installed automatically by webdriver-manager)

Limitations ⚠️

  • Some job sites may block automated scraping
  • LinkedIn may require authentication for certain jobs
  • Rate limiting may apply - avoid scraping too many jobs rapidly
  • Always respect the website's Terms of Service and robots.txt

Troubleshooting 🔧

Browser not found

The package automatically downloads ChromeDriver. Ensure you have Google Chrome installed.

403 Forbidden Error

Some sites may block requests. Try:

  • Using headless=False to run in visible browser mode
  • Adding delays between requests
  • Using a VPN or proxy

Encoding errors

The package handles most encoding issues automatically. If problems persist, the scraped data is returned as UTF-8.

Contributing 🤝

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

Ways to Contribute

  1. Report bugs - Open an issue on GitHub
  2. Add features - Submit a pull request
  3. Improve documentation - Fix typos or add examples
  4. Support more platforms - Add scrapers for other job sites

Publishing to PyPI 📤

To publish this package to PyPI so others can install it with pip install job-scraper-selenium:

1. Create PyPI account

2. Install publishing tools

pip install build twine

3. Build the package

python -m build

4. Upload to PyPI

# Test on TestPyPI first (optional)
twine upload --repository testpypi dist/*

# Upload to real PyPI
twine upload dist/*

5. Install your package

pip install job-scraper-selenium

License 📄

MIT License - see LICENSE file for details

Author ✍️

Your Name

Acknowledgments 🙏

  • Selenium for browser automation
  • BeautifulSoup for HTML parsing
  • webdriver-manager for automatic driver management

Support 💬

If you found this package helpful, please:

  • ⭐ Star the repository
  • 🐛 Report issues
  • 🔀 Submit pull requests
  • 📢 Share with others

Disclaimer: This package is for educational purposes. Always respect website Terms of Service and use responsibly.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

job_scraper_selenium-1.0.0.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

job_scraper_selenium-1.0.0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file job_scraper_selenium-1.0.0.tar.gz.

File metadata

  • Download URL: job_scraper_selenium-1.0.0.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for job_scraper_selenium-1.0.0.tar.gz
Algorithm Hash digest
SHA256 2a931a97cb3b6a60dab5aba116a22fc39d2bd0332444530efb8352844720ebdb
MD5 0459322623a578247c3a70e935cd0519
BLAKE2b-256 a00bed8bd7500f1bada8261e3a50ea52ad3b8969a1f567639c9017e6766a6586

See more details on using hashes here.

File details

Details for the file job_scraper_selenium-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for job_scraper_selenium-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 012b494e91fbc735ed1cacc48dfc926a2ed3fa324cd98bd7148860f1fb38b36b
MD5 c271f637aac2eb3b0dad04cbfa1fa9f9
BLAKE2b-256 4fddc036ce874df7dbe7125229895243f36fa929327ed694db0468d8797b183e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page