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.1.tar.gz (3.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.1-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: greek_scraper-0.1.1.tar.gz
  • Upload date:
  • Size: 3.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.1.tar.gz
Algorithm Hash digest
SHA256 4c2e7118b2959031d10bce0b7fcdd5eb656250df6b1dec5f306447a44e1ddd8c
MD5 e7c5485c760bb3b7834e5e0148f8b325
BLAKE2b-256 6e97cdab0d59ca1fa67550b53805d00eb4861536809de46c9d0ce347ba27e0e1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: greek_scraper-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.0 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a1aa8126c12cc7ed1fff5b88f4e907e806d291fcbc265b0af87757ca1117c793
MD5 3e7187c02777457696a0c663dce7a347
BLAKE2b-256 aa012766f89586b189739354bc61da909b9b58ac637f8d8c9d6f0118c391f668

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