11-27-2024, 01:38 PM
Playwright automates actions in web browser, such as "click link", "fill text field", "execute JavaScript", "open page".
Actions can be recorded.
Supports Chrome, Edge and other Chromium-based browsers. Partially Firefox.
System requirements: Windows 10+.
Examples
Actions can be recorded.
Supports Chrome, Edge and other Chromium-based browsers. Partially Firefox.
System requirements: Windows 10+.
Examples
// script "Playwright Connect.cs"
/// Connects to an existing web browser instance, finds a page by URL, activates the tab, and clicks a link.
/*/ c Playwrighter.cs; /*/
using Microsoft.Playwright;
using var play = Playwrighter.Connect(out var page, "https://www.libreautomate.com/forum/*");
await page.GetByText("Shared C# code").ClickAsync();
print.it(page.Url);
// script "Playwright Launch.cs"
/// Launches a web browser, opens a page, and clicks a link.
/*/ c Playwrighter.cs; /*/
using Microsoft.Playwright;
using var play = Playwrighter.Launch(out var page); //default browser
//using var play = Playwrighter.Launch(out var page, PWBrowser.BundledChrome); //bundled browser (installs if need)
await page.GotoAsync("https://www.libreautomate.com/forum/");
await page.GetByText("Shared C# code").ClickAsync();
dialog.show("Close the browser");