playwright — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited playwright (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Automate browsers with Playwright — Microsoft's modern browser automation framework. Faster and more reliable than Selenium, with built-in auto-wait and network control.
pip install playwright
playwright install chromium # or: playwright install (all browsers)from playwright.sync_api import sync_playwright
with sync_playwright() as p:
browser = p.chromium.launch(headless=False) # headless=True for no UI
page = browser.new_page()
page.goto("https://example.com")
print(page.title())
browser.close()import asyncio
from playwright.async_api import async_playwright
async def main():
async with async_playwright() as p:
browser = await p.chromium.launch()
page = await browser.new_page()
await page.goto("https://example.com")
print(await page.title())
await browser.close()
asyncio.run(main())page.click("button.submit") # Click a button
page.fill("#username", "my_user") # Fill an input
page.fill("#password", "my_pass")
page.select_option("select#country", "US") # Select dropdown
page.check("input#agree") # Check a checkbox
page.press("#search", "Enter") # Press a keypage.wait_for_selector(".results", timeout=10000) # Wait up to 10s
page.wait_for_load_state("networkidle") # Wait for network quiet
page.wait_for_url("**/dashboard") # Wait for navigationtext = page.text_content("h1") # Single element text
href = page.get_attribute("a.link", "href") # Attribute value
items = page.query_selector_all(".product") # Multiple elements
for item in items:
name = item.text_content()
price = item.query_selector(".price").text_content()page.screenshot(path="page.png") # Viewport screenshot
page.screenshot(path="full.png", full_page=True) # Full page
element = page.query_selector(".chart")
element.screenshot(path="chart.png") # Element onlypage.pdf(path="report.pdf", format="A4", print_background=True)# Block images to speed up loading
def handle_route(route):
if route.request.resource_type == "image":
route.abort()
else:
route.continue_()
page.route("**/*", handle_route)
page.goto("https://example.com")
# Intercept and modify a request
def modify_request(route):
headers = {**route.request.headers, "X-Custom": "value"}
route.continue_(headers=headers)
page.route("**/api/**", modify_request)context1 = browser.new_context()
context2 = browser.new_context()
page1 = context1.new_page() # Separate cookies, storage
page2 = context2.new_page() # Completely isolatedpage.set_viewport_size({"width": 1920, "height": 1080})
# Or emulate a device
iphone = p.devices["iPhone 13"]
context = browser.new_context(**iphone)browser = p.chromium.launch() # Chrome/Edge
browser = p.firefox.launch() # Firefox
browser = p.webkit.launch() # Safari| Error | Fix |
|---|---|
| "Browser not installed" | Run playwright install chromium |
| "Timeout waiting for selector" | Increase timeout or check selector |
| "Navigation failed" | Page might require JavaScript; use wait_for_load_state |
| "Element not visible" | Use force=True or wait for visibility |
time.sleep()headless=False for debugging, headless=True (default) for productionbrowser.new_context() creates an isolated session (separate cookies, localStorage)page.goto() waits for load event by default; use wait_until="networkidle" for SPAs~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.