Skip to main content

Scrape Wikipedia tables into CSVs or JSON

Project description

wikiscraperx

Overview

This repository contains the wikiscraperx project, a Python script designed to scrape tables from HTML documents and save them as CSV files. The project consists of two main Python files:

  1. tableParser.py: logic for parsing HTML tables.
  2. mainCli.py: CLI interface for the application.

Prerequisites

  • Python 3.x
  • Additional Python packages, as listed in requirements.txt.

Installation

To install the latest version:

pip install wikiscraperx

Or install from source:

git clone https://github.com/Joseph-Press/wikiscraperx.git
cd wikiscraperx
pip install .

Usage

Command Line Interface

Scrape all tables from a Wikipedia page to a folder (default CSV):

wikiscraperx --url "https://en.wikipedia.org/wiki/Python_(programming_language)" --output-folder ./output

Scrape to JSON format:

wikiscraperx --url "https://en.wikipedia.org/wiki/Python_(programming_language)" --output-folder ./output --format json

Save a specific table by its header (to stdout):

wikiscraperx --url "https://en.wikipedia.org/wiki/Python_(programming_language)" --header "Summary of Python 3's built-in types"

Save as JSON to stdout:

wikiscraperx --url "https://en.wikipedia.org/wiki/Python_(programming_language)" --header "Summary of Python 3's built-in types" --format json

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

wikiscraperx-1.0.5.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

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

wikiscraperx-1.0.5-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file wikiscraperx-1.0.5.tar.gz.

File metadata

  • Download URL: wikiscraperx-1.0.5.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for wikiscraperx-1.0.5.tar.gz
Algorithm Hash digest
SHA256 24ecc03e05ab9a7de2bfc325a3ecef1ea763f6e34fe8a13cb25ffff9cfeee8e0
MD5 a3f5a9c4cec57ac02711ec2a49c03bb1
BLAKE2b-256 88cdd1be349dfa0c2044464b9275b8f162edaa05ea2c7f6d8aa66e15316d9a87

See more details on using hashes here.

File details

Details for the file wikiscraperx-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: wikiscraperx-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for wikiscraperx-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 88a47a2d67e0152dd9de8b36f9ac8e8118b30d8b888f09768597b84e09a89ff1
MD5 b8cf0bc78c1d06dd6b460b68749bcc46
BLAKE2b-256 74270c8cde4e80185966f25994c5fff07ac90e68cd691d0af8f20ebc7d3a5868

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