Download preview/probe.py from hkblockchaintechnology/tiny-computer-agent: direct link, hf CLI and curl.
- Browser
- Download file 1.01 kB
-
https://huggingface.co/hkblockchaintechnology/tiny-computer-agent/resolve/main/preview/probe.py
- Command line
-
hf download hf://hkblockchaintechnology/tiny-computer-agent/preview/probe.py
-
curl -L -o probe.py https://huggingface.co/hkblockchaintechnology/tiny-computer-agent/resolve/main/preview/probe.py
1.01 kB
| from playwright.sync_api import sync_playwright | |
| URL = "https://huggingface.co/hkblockchaintechnology/tiny-computer-agent" | |
| with sync_playwright() as p: | |
| browser = p.chromium.launch() | |
| page = browser.new_page(viewport={"width": 1440, "height": 1100}) | |
| page.goto(URL, wait_until="load", timeout=120000) | |
| page.wait_for_timeout(6000) | |
| html = page.content() | |
| print("len(html):", len(html)) | |
| for needle in ["gallery/", "<img", "article img", "Capability gallery", | |
| "desk-click", "resolve/main/gallery"]: | |
| print(f" {needle!r:24} occurrences in DOM: {html.count(needle)}") | |
| print("total <img> on page:", page.eval_on_selector_all("img", "els => els.length")) | |
| print("containers:", page.eval_on_selector_all( | |
| "main, article, [class*=prose]", "els => els.slice(0,4).map(e => e.tagName + '.' + e.className.slice(0,40))")) | |
| # is the card text itself rendered? | |
| print("has heading text:", page.locator("text=Capability gallery").count()) | |
| browser.close() | |