我想这是一个经典的 C# 到 F# 的转换,我还没有完全理解。
我正在尝试使用快速启动自动化浏览器
https://playwright.dev/dotnet/docs/intro
C#代码是
using var playwright = await Playwright.CreateAsync();
await using var browser = await playwright.Chromium.LaunchAsync();
var page = await browser.NewPageAsync();
await page.GotoAsync("http://www.bing.com");
await page.ScreenshotAsync(path: outputFile);
我已经开始了,但已经有点迷失了。
let playwright: Playwright = PlaywrightSharp.Playwright.CreateAsync() |> Async.AwaitTask
类型不正确。我在这里做错了什么?
Error FS0001 This expression was expected to have type
'Playwright'
but here has type
'Async<IPlaywright>'