diff --git a/README.md b/README.md index 703076b..80a76b8 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ A powerful web operation automation library for .NET that enables you to define - **Reusable Targets**: Define named targets and call them from other targets - **Modern HTTP Client**: Uses `HttpClient` for better performance and reliability - **Cross-Platform**: Supports .NET Standard 2.0, .NET 8.0, and .NET 9.0 +- **Browser Automation**: Optional Playwright integration for JavaScript-rendered pages ## 📦 Installation @@ -32,6 +33,12 @@ Install via NuGet Package Manager: dotnet add package NetInteractor ``` +For browser automation with JavaScript rendering, also install the Playwright package: + +```bash +dotnet add package NetInteractor.Playwright +``` + Or via the Package Manager Console: ```powershell @@ -121,6 +128,28 @@ else } ``` +### 3. Using Playwright for JavaScript-Rendered Pages + +For websites that require JavaScript rendering (e.g., SPAs, dynamic content), use the Playwright web accessor: + +```csharp +using NetInteractor; +using NetInteractor.Config; +using NetInteractor.WebAccessors; + +// Load the configuration +var config = ConfigFactory.DeserializeXml("Scripts/Shop.config"); + +// Create the executor with a Playwright accessor for JavaScript support +await using var webAccessor = new PlaywrightWebAccessor(); +var executor = new InterationExecutor(webAccessor); + +// Execute the automation (same as before) +var result = await executor.ExecuteAsync(config, inputs); +``` + +> **Note**: Playwright requires browser binaries. Run `playwright install chromium` to install the required browser. + ## 📖 Script Reference ### Actions @@ -261,6 +290,8 @@ NetInteractor - HtmlAgilityPack (HTML parsing) - Microsoft.Extensions.Logging (Logging support) - Microsoft.Extensions.DependencyInjection (DI support) +- Optional Dependencies (for browser automation): + - Microsoft.Playwright (NetInteractor.Playwright package) ## 📄 License diff --git a/releaseNotes/v0.6.0.md b/releaseNotes/v0.6.0.md new file mode 100644 index 0000000..54983a5 --- /dev/null +++ b/releaseNotes/v0.6.0.md @@ -0,0 +1,33 @@ +# Release Notes v0.6.0 + +## What's New + +### New Features + +- **Playwright Web Accessor**: Added `NetInteractor.Playwright` package providing a Playwright-based implementation of `IWebAccessor`. This enables browser automation with Chromium/Firefox/WebKit for scenarios requiring JavaScript rendering. + - Supports GET and POST requests with full browser rendering + - Handles JavaScript-triggered redirects + - Configurable load delay for dynamic content + - Runs headless by default with customizable launch options + +### New Packages + +- **NetInteractor.Playwright**: Install via NuGet to use Playwright-based browser automation + ```bash + dotnet add package NetInteractor.Playwright + ``` + +## Breaking Changes + +None + +## Bug Fixes + +None + +## Dependencies + +- HtmlAgilityPack 1.12.4 +- Microsoft.Playwright 1.48.0 +- Microsoft.Extensions.DependencyInjection 9.0.0 +- Microsoft.Extensions.Logging 9.0.0 diff --git a/version.json b/version.json index 1709b11..c1339a4 100644 --- a/version.json +++ b/version.json @@ -1,6 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", - "version": "0.5.2", + "version": "0.6.0", "publicReleaseRefSpec": [ "^refs/heads/master$", "^refs/heads/v\\d+(?:\\.\\d+)?$"