Boundary Trail in Mount St. Helens National Volcanic Monument, Washington (© Don Geyer/Alamy)
My puppeteer scripts now use deno.
No more need for npm in my personal stack! The native
browser’s path comes from which
.
import puppeteer from "https://deno.land/x/puppeteer@16.2.0/mod.ts";
const chrome = "chromium"; // Browser Chrome: "firefox" | "chromium" | "google-chrome" | ...
const product = "chrome"; // Product Base: "firefox" | "chrome"
const command = new Deno.Command("which", { args: [chrome] });
const { status, stdout, stderr } = command.outputSync();
const executablePath = new TextDecoder().decode(stdout).trim();
const browser = await puppeteer.launch({
headless: false,
executablePath: executablePath,
product: product,
});
const site = "example.com";
const page = await browser.newPage();
await page.setViewport({ width: 1024, height: 768 });
await page.goto("https://" + site);
await page.screenshot({ path: site + ".png" });
await page.waitForSelector('a');
const url = await page.evaluate(() => {
return document.querySelector('a').href;
});
console.log(url);
await browser.close();
deno run --allow-all main.ts
nikitonsky: Don’t use different font size for no reason
Kiteboarders and windsurfers off the Pelješac Peninsula, Croatia (© helivideo/Getty Images)
dmitriid: In their infinite wisdom Google decided that you can only log in to the various services on the plethora of Google devices through a single central app on your phone. I’ve now tried to set up Spotify for a thousandth time. What went wrong? …
nikitonsky: If you are asking your users to update, maybe at least tell them why they should care?
Deno 1.25 Release Notes
North Cascades National Park, Washington (© Ethan Welty/Tandem Stills + Motion)
Safari Technology Preview Release 152 is now available for download for macOS Monterey 12.3 or later and macOS Ventura beta.
A 4G mobile network uses IP-based transport for the control plane to establish the data session at the user plane for the actual data