Download deploy/scripts/shot3.js from eduzrh/helloworld: direct link, hf CLI and curl.
- Browser
- Download file 1.47 kB
-
https://huggingface.co/datasets/eduzrh/helloworld/resolve/main/deploy/scripts/shot3.js
- Command line
-
hf download hf://datasets/eduzrh/helloworld/deploy/scripts/shot3.js
-
curl -L -o shot3.js https://huggingface.co/datasets/eduzrh/helloworld/resolve/main/deploy/scripts/shot3.js
1.47 kB
| const { chromium } = require('playwright-core'); | |
| (async () => { | |
| const browser = await chromium.launch({ | |
| executablePath: '/data/tools/chrome-headless-shell-linux64/chrome-headless-shell', | |
| args: ['--no-sandbox', '--disable-dev-shm-usage', '--use-gl=swiftshader', | |
| '--enable-unsafe-swiftshader'], | |
| }); | |
| const ctx = await browser.newContext({ viewport: { width: 1600, height: 1000 } }); | |
| const page = await ctx.newPage(); | |
| await page.goto('http://127.0.0.1/', { waitUntil: 'domcontentloaded', timeout: 60000 }); | |
| await page.waitForTimeout(15000); | |
| const sels = ['button:has-text("CONTINUE")', 'button:has-text("NEXT")', | |
| 'button:has-text("SKIP")', 'button:has-text("GET STARTED")', | |
| 'button:has-text("ENTER")', 'button:has-text("LAUNCH")', 'button[aria-label="Close"]']; | |
| for (let i = 0; i < 8; i++) { | |
| let clicked = false; | |
| for (const s of sels) { | |
| try { | |
| const el = page.locator(s).first(); | |
| if (await el.count() && await el.isVisible()) { | |
| await el.click({ timeout: 4000 }); clicked = true; | |
| await page.waitForTimeout(4000); break; | |
| } | |
| } catch (e) {} | |
| } | |
| if (!clicked) break; | |
| } | |
| await page.waitForTimeout(45000); | |
| await page.screenshot({ path: '/data/shots/shadowbroker_ready.png' }); | |
| const t = (await page.evaluate(() => document.body.innerText)).replace(/\s+/g, ' '); | |
| console.log('TEXT:', t.slice(0, 500)); | |
| await browser.close(); | |
| })(); | |