Skip to content

Commit 828bf2c

Browse files
committed
Merge branch 'release/3.0.0'
2 parents c8aabed + ef27d4a commit 828bf2c

27 files changed

+392
-3226
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<TargetFramework>netstandard2.0</TargetFramework>
55
<Authors>Kameleo Team</Authors>
66
<Company>Kameleo</Company>
77
<PackageTags>kameleo; stealth browsing platform; anti-detect browser; selenium; webdriver; browser automation; web scraping; puppeteer; playwright; headless; chrome; firefox; chromium; edge</PackageTags>
8-
<Version>2.11.0</Version>
8+
<Version>3.0.0</Version>
99
<Description>This .NET Standard package provides convenient access to the Local API REST interface of the Kameleo Client.</Description>
1010
<PackageProjectUrl>https://kameleo.io</PackageProjectUrl>
1111
<RepositoryUrl>https://github.com/kameleo-io/local-api-client-csharp</RepositoryUrl>
@@ -17,7 +17,7 @@
1717
</PropertyGroup>
1818

1919
<ItemGroup>
20-
<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="2.3.23" />
20+
<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="2.3.*" />
2121
</ItemGroup>
2222

2323
</Project>

Kameleo.LocalApiClient.sln

Lines changed: 0 additions & 25 deletions
This file was deleted.

README.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Install-Package Kameleo.LocalApiClient
3434
./Kameleo.CLI.exe email="your@email.com" password="Pa$$w0rd"
3535
```
3636

37-
## 3. Start a browser with out-of-the-box fingerprinting protection
37+
## 3. Start a browser with out-of-the-box fingerprinting protection
3838
```csharp
3939
using System;
4040
using System.Threading.Tasks;
@@ -77,12 +77,12 @@ Kameleo gives you the ability to control any supported browser using Selenium. I
7777

7878
You need to install the official [Selenium package](https://www.nuget.org/packages/Selenium.WebDriver/).
7979
```csharp
80-
using OpenQA.Selenium;
8180
using OpenQA.Selenium.Chrome;
8281
using OpenQA.Selenium.Remote;
8382
```
8483

8584
```csharp
85+
const int KameleoPort = 5050;
8686
// Connect to the running browser instance using WebDriver
8787
var uri = new Uri($"http://localhost:{KameleoPort}/webdriver");
8888
var opts = new ChromeOptions();
@@ -108,6 +108,7 @@ using PuppeteerSharp;
108108

109109
```csharp
110110
// Connect to the browser through CDP
111+
const int KameleoPort = 5050;
111112
var browserWsEndpoint = $"ws://localhost:{KameleoPort}/puppeteer/{profile.Id}";
112113
var browser = await Puppeteer.ConnectAsync(new ConnectOptions { BrowserWSEndpoint = browserWsEndpoint, DefaultViewport = null });
113114
var page = await browser.NewPageAsync();
@@ -128,10 +129,13 @@ You need to import the official [Playwright package](https://www.nuget.org/packa
128129
using Microsoft.Playwright;
129130
```
130131

132+
You can find more details here: [Using Kameleo with Playwright framework – Kameleo Support Center](https://help.kameleo.io/hc/en-us/articles/4419471627793-Using-Kameleo-with-Playwright-framework).
133+
131134
## Chromium-based profiles with Playwright
132135

133136
```csharp
134137
// Connect to the browser with Playwright through CDP
138+
const int KameleoPort = 5050;
135139
var browserWsEndpoint = $"ws://localhost:{KameleoPort}/playwright/{profile.Id}";
136140
var playwright = await Playwright.CreateAsync();
137141
var browser = await playwright.Chromium.ConnectOverCDPAsync(browserWsEndpoint);
@@ -153,21 +157,25 @@ The full example can be found [here](https://github.com/kameleo-io/local-api-exa
153157

154158
```csharp
155159
// Connect to the browser with Playwright
160+
const int KameleoPort = 5050;
156161
var browserWsEndpoint = $"ws://localhost:{KameleoPort}/playwright/{profile.Id}";
157162
var playwright = await Playwright.CreateAsync();
163+
// The exact path to the bridge executable is subject to change. Here, we use %LOCALAPPDATA%\Programs\Kameleo\pw-bridge.exe
164+
var localAppDataFolder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
165+
var executablePath = Path.Combine(localAppDataFolder, "Programs", "Kameleo", "pw-bridge.exe");
158166
var browser = await playwright.Firefox.LaunchPersistentContextAsync("", new BrowserTypeLaunchPersistentContextOptions
159167
{
160-
// The Playwright framework is not designed to connect to already running
161-
// browsers. To overcome this limitation, a tool bundled with Kameleo, named
162-
// pw-bridge.exe will bridge the communication gap between the running Firefox
168+
// The Playwright framework is not designed to connect to already running
169+
// browsers. To overcome this limitation, a tool bundled with Kameleo, named
170+
// pw-bridge.exe will bridge the communication gap between the running Firefox
163171
// instance and this playwright script.
164-
ExecutablePath = "<PATH_TO_KAMELEO_FOLDER>\\pw-bridge.exe",
172+
ExecutablePath = executablePath,
165173
Args = new List<string> { $"-target {browserWsEndpoint}" },
166174
ViewportSize = null,
167175
});
168176

169177
// Kameleo will open the a new page in the default browser context.
170-
// NOTE: We DO NOT recommend using multiple browser contexts, as this might interfere
178+
// NOTE: We DO NOT recommend using multiple browser contexts, as this might interfere
171179
// with Kameleo's browser fingerprint modification features.
172180
var page = await browser.NewPageAsync();
173181

@@ -200,7 +208,7 @@ var createProfileRequest = BuilderForCreateProfile
200208
var profile = await client.CreateProfileAsync(createProfileRequest);
201209

202210
// Start the profile with a couple of extra parameters, so Selenium automation can be done fluently
203-
await client.StartProfileWithWebDriverSettingsAsync(profile.Id, new WebDriverSettings()
211+
await client.StartProfileWithOptionsAsync(profile.Id, new WebDriverSettings()
204212
{
205213
AdditionalOptions = new List<Preference>
206214
{
@@ -230,11 +238,12 @@ The full example can be found [here](https://github.com/kameleo-io/local-api-exa
230238
- Modify and Delete browser cookies
231239
- Start profile with extra WebDriver capabilities
232240
- How to duplicate virtual browser profiles
233-
- Test proxies
234241
- Refresh the browser of the emulated profiles
235242

236243
> Note: _If you are interested in more information about Kameleo, or have encountered an issue with using it, please check out our [Help Center](https://help.kameleo.io/)._
237244
245+
# Package
246+
This package can be found on NuGet Gallery here: [Kameleo.LocalApiClient](https://www.nuget.org/packages/Kameleo.LocalApiClient).
238247

239248
# License
240249
This project is released under MIT License. Please refer the LICENSE.txt for more details.

docs/README.md

Lines changed: 0 additions & 26 deletions
This file was deleted.

docs/build.ps1

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)