方法1 Playwright
npm install -g playwright
npx playwright install-deps
npx playwright install chromium
npx playwright screenshot --full-page --wait-for-timeout=3000 https://24h.pchome.com.tw screenshot.png
方法2 Chromium
dnf install chromium -y
chromium-browser --headless --disable-gpu --screenshot --window-size=1920,1080 https://24h.pchomec.com.tw
結果會輸出到當前目錄的 screenshot.png
方法1會自動捲動,存下完整頁面,方法2局限於指定的大小
沒有留言:
張貼留言