A tool for scraping job listings from Naukri.com
Project description
🚀 Naukri.com Job Scraper
A powerful Python package for scraping job listings from Naukri.com, allowing you to search for jobs by title and collect detailed information in a CSV format. Available as both a command-line tool and a Python library.
📋 Table of Contents
- Features
- Requirements
- Installation
- Usage
- Project Structure
- How It Works
- Sample Output
- Contributing
- Connect With Me
- License
✨ Features
- 🔍 Search for jobs by title on Naukri.com
- 📄 Export job listings to CSV files for easy analysis
- 📊 Extract comprehensive job details including:
- Job title
- Company name
- Job description
- Company logo URL
- Experience requirements
- Job location
- Posted date
- Salary information
- Skills required
- Job ID and URL
- 📱 User-friendly command-line interface
- 📃 Page navigation functionality
📦 Requirements
- Python 3.6+
requestslibrary- Internet connection
💾 Installation
Using pip (recommended)
pip install naukri-scraper
From source
git clone https://github.com/pawankumar941394/naukri-scraper.git
cd naukri-scraper
pip install -e .
🚀 Usage
Method 1: Command Line Interface
# Interactive mode (will prompt for job title and page number)
naukri-scraper
# With command line arguments
naukri-scraper --title "Python Developer" --page 1
Method 2: Python Code - Interactive Mode
from naukri_scraper import scraper
# This will prompt for job title and page number
scraper.main()
Method 3: Python Code - Direct API
from naukri_scraper.scraper import scrape_jobs
# Define job search parameters
job_title = "Data Scientist"
page_number = 1
# Call the function to scrape jobs
result = scrape_jobs(job_title, page_number)
if result:
job_count, csv_filename = result
print(f"Found {job_count} jobs matching '{job_title}'")
print(f"Results saved to: {csv_filename}")
Method 4: Advanced Usage with Data Analysis
import csv
import os
from naukri_scraper.scraper import scrape_jobs
# Get job data
job_title = "Machine Learning"
result = scrape_jobs(job_title, 1)
if result:
job_count, csv_filename = result
# Example: Analyze the data
with open(csv_filename, 'r', encoding='utf-8') as f:
reader = csv.DictReader(f)
jobs = list(reader)
# Get unique locations
locations = set()
for job in jobs:
if 'Location' in job and job['Location'] != 'N/A':
locations.add(job['Location'])
print(f"Found jobs in {len(locations)} different locations")
📁 Package Structure
naukri_scraper/
├── __init__.py # Package initialization
├── scraper.py # Main scraping functionality
├── headers.py # Contains headers configuration for HTTP requests
└── cookies.py # Contains cookies configuration for HTTP requests
🔧 How It Works
- The package sends an HTTP request to Naukri.com's API with your search query
- It uses custom headers and cookies to simulate a browser session
- The API response is parsed to extract job details
- Job information is displayed in the terminal and saved to a CSV file
- The CSV file can be further analyzed using Python's data analysis tools
- You can search for multiple job titles by running the tool again
📊 Sample Output
The script generates a CSV file with the following columns:
- Title
- Company
- Job Description
- Logo URL
- Experience
- Location
- Posted Date
- Salary
- Job ID
- Job URL
- Skills
📈 Example Code
See EXAMPLES.md for more detailed examples of how to use this package in your projects.
💻 Complete Usage Guide
For a comprehensive guide on installation, usage, and advanced features, see USAGE_GUIDE.md.
👥 Contributing
Contributions are welcome! Feel free to submit pull requests or open issues to improve this project.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
🔗 Connect With Me
📜 License
This project is licensed under the MIT License - see the LICENSE file for details.
Developed with ❤️ by Pawan Kumar
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file naukri_scraper-0.1.1.tar.gz.
File metadata
- Download URL: naukri_scraper-0.1.1.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e29f77d129574b0438de2b8f08bc3e3b4cd39dd24261f62407fac4074bbcc244
|
|
| MD5 |
a133c03022e759d559b0bcf3e89f689e
|
|
| BLAKE2b-256 |
b144364fc6f5b3a9cc448498ffabe7e339f6f6479f05e2a469e73007644dc997
|