Playwright-based scraper implementation for The Pudim Hunter platform
Project description
Pudim Hunter Driver Scraper 🍮
Table of Contents
- Features
- Usage
- Installation
- Interface Overview
- Project Structure
- Installation
- Virtual Environment Setup
- Prerequisites
- macOS and Linux
- Windows
- Troubleshooting
- Development
- Contributing
- Getting Started
- Pull Request Process
- Repository
- License
A Python package that provides a Playwright-based scraper implementation for The Pudim Hunter platform. This package extends the pudim-hunter-driver interface to provide a common base for implementing job board scrapers.
Features
- Playwright-based web scraping
- Async support for better performance
- Headless browser automation
- Easy-to-extend base classes for job board implementations
- Built-in error handling and resource management
- Type hints and validation using Pydantic
Usage
Installation
You can install the package directly from PyPI:
# Install directly using pip
pip install pudim-hunter-driver-scraper
# Or add to your requirements.txt
pudim-hunter-driver-scraper>=0.0.1 # Replace with the version you need
For development installations, see the Development section.
Interface Overview
This package provides the base scraper implementation for job search drivers. To create a scraper for a specific job board, you'll need to extend the ScraperJobDriver class and implement the required methods.
-
ScraperJobDriver(ABC) - The base scraper class that implementsJobDriver:async build_search_url(query: JobQuery) -> strdef get_selectors() -> Dict[str, str]def transform_data(data: Dict[str, Any]) -> Optional[Job]
-
PlaywrightScraper- The base scraper implementation:- Supports both sync and async operations
- Handles browser lifecycle
- Provides navigation and data extraction methods
-
Exceptions:
- Inherits all exceptions from
pudim-hunter-driver - Adds scraper-specific error handling
- Inherits all exceptions from
Project Structure
pudim-hunter-driver-scraper/
├── src/
│ └── pudim_hunter_driver_scraper/
│ ├── __init__.py # Package initialization
│ ├── scraper.py # PlaywrightScraper implementation
│ └── driver.py # ScraperJobDriver implementation
├── tests/ # Test directory
│ └── __init__.py
├── README.md # This file
├── requirements.txt # Direct dependencies
├── setup.py # Package setup
└── pyproject.toml # Project configuration
Installation
From PyPI:
pip install pudim-hunter-driver-scraper
From source:
git clone git@github.com:luismr/pudim-hunter-driver-scraper.git
cd pudim-hunter-driver-scraper
pip install -r requirements.txt
For development:
pip install -e .
Virtual Environment Setup
We strongly recommend using a virtual environment for development and testing. This isolates the project dependencies from your system Python packages.
Prerequisites
- Python 3.9 or higher
- pip (Python package installer)
- venv module (usually comes with Python 3)
macOS and Linux
- Open Terminal and navigate to the project directory:
cd pudim-hunter-driver-scraper
- Create a virtual environment:
python3.9 -m venv venv
- Activate the virtual environment:
source venv/bin/activate
- Install dependencies:
pip install -r requirements.txt
pip install -e . # for development
- Install Playwright browsers:
playwright install chromium
- To deactivate when done:
deactivate
Windows
- Open Command Prompt or PowerShell and navigate to the project directory:
cd pudim-hunter-driver-scraper
- Create a virtual environment:
python -m venv venv
- Activate the virtual environment:
- In Command Prompt:
.\venv\Scripts\activate.bat
- In PowerShell:
.\venv\Scripts\Activate.ps1
- Install dependencies:
pip install -r requirements.txt
pip install -e . # for development
- Install Playwright browsers:
playwright install chromium
- To deactivate when done:
deactivate
Troubleshooting
macOS/Linux
- If
python3.9is not found, install it using your package manager:- macOS (with Homebrew):
brew install python@3.9 - Ubuntu/Debian:
sudo apt-get install python39 python39-venv - CentOS/RHEL:
sudo yum install python39 python39-devel
- macOS (with Homebrew):
Windows
- Ensure Python is added to your PATH during installation
- If PowerShell execution policy prevents activation:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Development
- Create and activate a virtual environment:
python3.9 -m venv venv
source venv/bin/activate
- Install in development mode:
pip install -e .
Contributing
We love your input! We want to make contributing to Pudim Hunter Driver Scraper as easy and transparent as possible, whether it's:
- Reporting a bug
- Discussing the current state of the code
- Submitting a fix
- Proposing new features
- Becoming a maintainer
Getting Started
- Fork the repository
# Clone the repository
git clone git@github.com:luismr/pudim-hunter-driver-scraper.git
cd pudim-hunter-driver-scraper
# Create your feature branch
git checkout -b feature/amazing-feature
# Set up development environment
python3.9 -m venv venv
source venv/bin/activate
pip install -e .
-
Make your changes
- Write clear, concise commit messages
- Add tests for any new functionality
- Ensure all tests pass:
pytest tests/ -v
-
Push to your fork and submit a pull request
git push origin feature/amazing-feature
Pull Request Process
- Update the README.md with details of changes if needed
- Add any new dependencies to requirements.txt
- Update the tests if needed
- The PR will be merged once you have the sign-off of the maintainers
Repository
- Main repository: github.com/luismr/pudim-hunter-driver-scraper
- Issue tracker: github.com/luismr/pudim-hunter-driver-scraper/issues
License
This project is licensed under the MIT License - see the LICENSE.md file for details.
Copyright (c) 2024-2025 Luis Machado Reis
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pudim-hunter-driver-scraper-0.0.6.tar.gz.
File metadata
- Download URL: pudim-hunter-driver-scraper-0.0.6.tar.gz
- Upload date:
- Size: 12.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e79d533c3ab0c5f0851c6509513d276905b999c0e69125d26f92b4fc783f4366
|
|
| MD5 |
377592052da740fdcc0a2dc559d09e77
|
|
| BLAKE2b-256 |
8075a2429a3b98d0b902d4aa08c244ac6eeeb6fd9276420edcd9833b41f22d01
|
File details
Details for the file pudim_hunter_driver_scraper-0.0.6-py3-none-any.whl.
File metadata
- Download URL: pudim_hunter_driver_scraper-0.0.6-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0f4d382c95b59e4ad1658ba7263731709888288408fce04ae3b6f0633af4549
|
|
| MD5 |
4caf75eee04bf18e4b3bd8777d473124
|
|
| BLAKE2b-256 |
e73c86b9337df0e2a3d83784efc54158c0e0cc41bf4fb57706c76c8ee0dc8fe5
|