Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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<InteractConfig>("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
Expand Down Expand Up @@ -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

Expand Down
33 changes: 33 additions & 0 deletions releaseNotes/v0.6.0.md
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -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+)?$"
Expand Down
Loading