使用本地配置,跳过开始自动下载
Playwright.CreateOptions options = new Playwright.CreateOptions();
HashMap<String, String> map = new HashMap<>();
map.put("PLAYWRIGHT_BROWSERS_PATH", "/Users/Desktop/");
map.put("PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD", "1");
options.setEnv(map);
Playwright playwright = Playwright.create(options);
使用本地代理
Browser browser = playwright.chromium().launch(new BrowserType.LaunchOptions().setProxy(new Proxy("http://10.0.1.1:7890")).setHeadless(false));
评论