UNPKG

rabbit-browser

Version:

Browser automation tool for detecting interactive elements on web pages

31 lines 1.19 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const index_1 = __importDefault(require("../index")); /** * Simple example of RabbitBrowser with text and element highlighting */ async function main() { try { // Navigate to a website console.log("Navigating to website..."); await index_1.default.go("https://www.liftos.io"); // Get the complete data const completeData = await index_1.default.getCompleteData(); // Log the counts console.log(`\nDetected ${completeData.elements.length} interactive elements and ${completeData.textBlocks.length} text blocks`); // Display the full data as JSON console.log("\nComplete data for AI analysis:"); console.log(JSON.stringify(completeData, null, 2)); // Close the browser when done await index_1.default.close(); } catch (error) { console.error("Error:", error); } } // Run the example main().catch(console.error); //# sourceMappingURL=simple-usage.js.map