Skip to main content

A CLI tool to convert HTTP content to Markdown

Project description

http2md

A CLI tool to fetch web pages and convert them to Markdown using Playwright.

Installation

pip install http2md
http2md install

Usage

# Basic usage (converts to Markdown)
http2md https://example.com

# Basic usage out to file (converts to Markdown)
http2md https://example.com -o output.md

# Output raw HTML
http2md https://example.com --html

# Wait for a specific element before extracting
http2md https://spa-site.com --wait-for ".content"

# Increase timeout for slow sites (default: 30000ms)
http2md https://slow-site.com --timeout 60000

# Use specific wait strategy
http2md https://fast-site.com --wait-until load

CLI Options

usage: http2md [-h] [--html]
               [--wait-until {auto,load,domcontentloaded,networkidle,commit}]
               [--timeout TIMEOUT] [--wait-for WAIT_FOR] [-o OUT]
               [url]

Convert HTTP content to Markdown

positional arguments:
  url                   URL to process

options:
  -h, --help            show this help message and exit
  --html                Output raw HTML instead of Markdown
  --wait-until          Wait strategy (default: auto)
  --timeout TIMEOUT     Timeout in milliseconds (default: 30000)
  --wait-for WAIT_FOR   CSS selector to wait for before extracting content
  -o, --out OUT         Output file path

Wait Strategies

Strategy Description
auto Combined: tries networkidle, falls back on timeout (default)
load Wait for load event
domcontentloaded Wait for DOM to be ready
networkidle Wait for no network activity (500ms)
commit Return immediately after response headers

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

http2md-0.0.1.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

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

http2md-0.0.1-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file http2md-0.0.1.tar.gz.

File metadata

  • Download URL: http2md-0.0.1.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for http2md-0.0.1.tar.gz
Algorithm Hash digest
SHA256 79f77848a30cc9ac19495b88f68a32e383ba910daa0f0710fb52f559a9b72eba
MD5 954ffda9cd86d172878c10cda0c7aa91
BLAKE2b-256 05872d87a765530883e5ea4fe12a12d3a2dd32eb6fbd76a55477d2104aaaddee

See more details on using hashes here.

File details

Details for the file http2md-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: http2md-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for http2md-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f0468bc3bd74ab8b73079e20b70f2ba051e088c94d30c15884b180ccdc63f02a
MD5 861654a1e9e877b0c53fee9e6a3140b5
BLAKE2b-256 0348fce315b2003ad62d6012873befdc4a2ea3341d7eb94ba8950361978df4a7

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