photonos

Crates.iophotonos
lib.rsphotonos
version0.3.0
created_at2025-04-16 14:06:42.099827+00
updated_at2025-04-22 13:09:31.332738+00
descriptionA wget-like CLI that renders JavaScript-powered pages using Chromium with pure Rust
homepage
repositoryhttps://github.com/4383/photonos
max_upload_size
id1636483
size101,092
Hervé Beraud (4383)

documentation

README

Photonos

Photonos is a wget-like tool that can render JavaScript-powered websites using a headless browser, allowing you to capture the fully rendered HTML content and take screenshots of modern web applications.

Installation

Once the requirements are met (see Requirements section below), you can install Photonos directly from crates.io:

cargo install photonos

Usage

Photonos works similar to wget, but with JavaScript rendering:

photonos https://example.com -o output.html --screenshot screenshot.png

Requirements

Photonos has two main dependencies:

1. Chrome/Chromium

Chrome or Chromium is required as it's the browser engine used for rendering web pages. Install it for your distribution:

Debian / Ubuntu

sudo apt-get update
sudo apt-get install -y chromium-browser

Fedora

sudo dnf install -y chromium

Arch Linux

sudo pacman -S chromium

2. Rust and Cargo

Rust and Cargo are needed to build and install Photonos:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env

Why does Photonos need Chromium?

Photonos uses chromiumoxide, a pure Rust library to control the Chrome/Chromium browser. This allows it to:

  • Render modern web pages with JavaScript support
  • Take screenshots exactly as they would appear in a browser
  • Interact with dynamic content

The pure Rust approach leverages the power of modern browser rendering while maintaining the performance benefits of Rust.

Troubleshooting

If you can't run Photonos after installation, make sure that Cargo's bin directory is in your PATH:

export PATH="$HOME/.cargo/bin:$PATH"

For persistent configuration, add this line to your ~/.bashrc, ~/.zshrc, or equivalent shell configuration file.

Commit count: 6

cargo fmt