webotron
v0.0.12
Published
Webotron bip bop
Downloads
566
Readme
webotron

A lightweight Chrome automation library for Bun and TypeScript.
Quick example
import { ChromeWebView } from "webotron";
const view = new ChromeWebView({
headless: false,
initialUrl: "https://example.com",
// Optional when Chrome is installed in a standard location:
// chromePath: "C:/Program Files/Google/Chrome/Application/chrome.exe",
});
try {
await view.waitForDocumentReady({ state: "complete", timeoutMs: 15000 });
await view.waitForElement("#username", { timeoutMs: 10000 });
await view.click("#username");
await view.type("hello from webotron");
await view.waitForElement("button[type='submit']", { timeoutMs: 10000 });
await view.click("button[type='submit']");
} finally {
await view.close();
}