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.5.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.5-py3-none-any.whl (2.1 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: miniclient-0.0.5.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.5.tar.gz
Algorithm Hash digest
SHA256 57809bfa26b3f6749d2dfeb92c9a986c261e8fa58ee44857a83da8b61b205e8a
MD5 d67cbfb517026fa9671fbb38f663ce75
BLAKE2b-256 14e1683f15ae73e38dc4cf70dbef45c6d976010ea8f62c5cd3ad707ce946edb0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: miniclient-0.0.5-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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 1baffc8b069352a517971909238fe859c0310071b17409e0551a4d4c757ac61f
MD5 3818dccefbc55a783f9a249eb97d5857
BLAKE2b-256 a6ec5c70026913583ebb3f165ddabe592e3af65cadf044e0a1de2948f073912a

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