Skip to main content

Ultra-fast and efficient web scraper with GPU utilization for text cleaning and JSON output. Supports generic and language-specific scraping.

Project description

Greek Web Scraper

Greek Scraper

A high-performance web scraper built with Scrapy, optimized for Greek-language content extraction. Supports GPU acceleration for text processing and provides robust retry mechanisms for reliable scraping.

🚀 Features

  • Efficient Web Scraping: Uses Scrapy with custom middlewares.
  • GPU Acceleration: Cleans and filters Greek text using CuPy.
  • Robust Encoding Handling: Automatic encoding detection and conversion.
  • Custom Retry Mechanism: Skips domains with persistent failures.
  • Parallel Domain Scraping: Configurable concurrent requests.
  • Automatic Text Extraction: Uses trafilatura and BeautifulSoup.
  • Storage Pipelines: Outputs cleaned text to JSONL and JSON.

📂 Project Structure

greek_scraper/
│── middlewares.py  # Custom Scrapy middlewares for encoding & retries
│── pipelines.py    # Data processing & storage pipelines
│── spider.py       # Main Scrapy spider for scraping Greek websites
│── gpu_processor.py # GPU-based text processing
│── cli.py          # Command-line interface for running the scraper
│── __init__.py     # Entry point & helper functions

⚙️ Installation

  1. Clone the repository

    git clone https://github.com/your-repo/greek_scraper.git
    cd greek_scraper
    
  2. Install dependencies

    pip install -r requirements.txt
    
  3. Ensure CUDA & CuPy are installed (if using GPU)

    pip install cupy-cuda12x  # Adjust CUDA version if needed
    

🕵️ Usage

Single Domain Scraping

import greek_scraper

greek_scraper.scrape("example.gr")

Multi-Domain Scraping

import greek_scraper

greek_scraper.multi_scrape(["example.gr", "another.gr"])

Scraping from a File

import greek_scraper

greek_scraper.from_file("domains.txt")

Custom Configuration

import greek_scraper

greek_scraper.gpu(True)  # Enable GPU processing
greek_scraper.output_path("output.jsonl")
greek_scraper.language("greek")
greek_scraper.threads(4)
greek_scraper.speed(7)

🛠 Configuration

Function Description Default Value
gpu(True/False) Enables/disables GPU processing False
output_path("file.jsonl") Sets output file name scraped_data.jsonl
threads(n) Sets concurrent requests per domain 1
speed(n) Controls scraping speed (1-10) 5
language("greek") Filters text by language (Greek only) greek

📜 License

This project is licensed under the MIT License.


👨‍💻 Author

Charis NikolaidisGitHubncharis97@gmail.com

🌟 Show Your Support!

Give a ⭐ if you like this project and find it useful!

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

greek_scraper-0.1.2.tar.gz (12.8 kB view details)

Uploaded Source

Built Distribution

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

greek_scraper-0.1.2-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file greek_scraper-0.1.2.tar.gz.

File metadata

  • Download URL: greek_scraper-0.1.2.tar.gz
  • Upload date:
  • Size: 12.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for greek_scraper-0.1.2.tar.gz
Algorithm Hash digest
SHA256 ac5ea5643cd0129999be98efd2b399a491ee5475f73276e5f57aa50521bcd7c1
MD5 8552d96e082dc6e4c79c0435c2e06340
BLAKE2b-256 86d834a442094bfbf34f5613ba49df48ea2273f46eae917a2adcf9cad5747584

See more details on using hashes here.

File details

Details for the file greek_scraper-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: greek_scraper-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for greek_scraper-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1e7f0c58e69552e8f0ab2c3644a72146593c4d0cb33a98c64ddb01861f6fd39e
MD5 74779e4f0b5d2fa2dadd75256db18f85
BLAKE2b-256 a061bcbcdd341ed2020ee3b90dfa49ffad5d6a02d9a2bf38345dd6123a16c322

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