Skip to main content

A minimal python http client that runs real JS/DOM (htmx and friends) without a browser

Project description

miniclient

CI codecov Docs PyPI Python versions License

A minimal python http client that runs JavaScript, without a browser. Meant to be used as a lightweight test client to simulate browser interactions. Embeds a V8 Runtime, DOM, and is designed to run htmx especially well.

Install

uv add miniclient

Example

The snippet below opens a page, submits a search form, clicks a "load more" button and reads the results back. All against a real in-memory DOM running JavaScript (htmx, for example). No browser involved.

from miniclient.browser import Browser

with Browser() as browser:
    browser.goto("http://localhost:8000/")
    browser.find("input[name=q]").fill("htmx")
    browser.find("form").requestSubmit()
    browser.find("#load-more").click()
    print(len(browser.find_all("#results li")), "results")
    print(browser.find("#results li:first-child").text())

Check the full documentation: https://marciomazza.github.io/miniclient/

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

miniclient-0.0.4.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

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

miniclient-0.0.4-py3-none-any.whl (2.1 MB view details)

Uploaded Python 3

File details

Details for the file miniclient-0.0.4.tar.gz.

File metadata

  • Download URL: miniclient-0.0.4.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for miniclient-0.0.4.tar.gz
Algorithm Hash digest
SHA256 1c4205e5876dfa8971b1989c05044cf038acd772c8cc7de67a054a64554e8afc
MD5 caee5cfc46a9a2e77ac62fdb524c215c
BLAKE2b-256 110c2abdecf76c3d0f9e83a4a86bf203506a2c140584f857c0cd5e33c92cbb4a

See more details on using hashes here.

File details

Details for the file miniclient-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: miniclient-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for miniclient-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e142ee29f3f6a327028fb7499d0719e0ae4132d3b2a5d8a7ee591aeb7c987f1c
MD5 e2f4e9a9ac307d6ea65b5cc3abd4fa9a
BLAKE2b-256 b9c345119d841371add637e302a13f4e5da23ff38b4dd2860a1d72e6f5bdf021

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