Astral is a Puppeteer/Playwright-like library designed with Deno in mind.
Most things that you can do manually in the browser can be done using Astral! Here are a few examples to get you started:
Before we go into the depths of the API, let's see a quick demo first:
// Import Astral
import { launch } from "https://deno.land/x/astral/mod.ts";
// Launch the browser
const browser = await launch();
// Open a new page
const page = await browser.newPage("https://deno.land");
// Take a screenshot of the page and save that to disk
const screenshot = await page.screenshot();
Deno.writeFileSync("screenshot.png", screenshot);
// Close the browser
await browser.close();
You can run this from the command line using:
deno run -A https://deno.land/x/astral/examples/screenshot.ts