Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Web browser automation with Playwright
#1
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
 
Code:
Copy      Help
// 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);
 
Code:
Copy      Help
// 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");


Attached Files
.zip   Playwrighter.zip (Size: 10.52 KB / Downloads: 34)
#2
Thanks for adding the file Smile  im learn so many from this


Forum Jump:


Users browsing this thread: 2 Guest(s)