admin 管理员组

文章数量: 887021

  1. 操作时时显示浏览器
    import os
    import asyncio
    from playwright.sync_api import sync_playwright

with sync_playwright() as p:
browser = p.chromium.launch(headless=False)
page = browser.new_page()
page.goto(“http://www.baidu”)
print(page.title())
browser.close()

2.无头浏览器
import os
import asyncio
from playwright.sync_api import sync_playwright

with sync_playwright() as p:
browser = p.chromium.launch()
page = browser.new_page()
page.goto(“http://www.baidu”)
print(page.title())
browser.close()

本文标签: 浏览器 操作 基础 playwrite