In this article we are going to show you how to change WebGL during the creation of your virtual browser profile through the Local API Clients.
To learn more about WebGL and how Kameleo is spoofing it in order to let you bypass anti-bot systems during your web-scraping or browser automation projects please read the following articles:
Concept
During the CreateProfileRequest
POST /profiles/new
You can pass the CreateProfileRequest object that has a WebglSpoofingType property. This can be used to set up WebGL spoofing. Possible values are
- Noise: Get a unique WebGL hash to customize the profile
- Block: Block the WebGL feature in your browser to prevent potential tracking. May cause issues with graphics-intensive websites
- Off: Turn off the spoofing, use the original settings (Default)
We suggest you to use the Off setting given that it's set to default..
To set the WebGL spoofing type, use the WebGL
method in the Local API Clients. Below you can find the examples for Javascript and Python:
Examples
-
@type {import('@kameleo/local-api-client').CreateProfileRequest} */ const createProfileRequest = { fingerprintId: fingerprints[0].id, webgl: 'noise' // Valid values: 'noise', 'block', 'off' }; const profile = await client.profile.createProfile(createProfileRequest);
-
from kameleo.local_api_client.models import CreateProfileRequest from kameleo.local_api_client.models.webgl_spoofing_type import WebglSpoofingType create_profile_request = CreateProfileRequest( fingerprint_id=fingerprints[0].id, webgl='noise' # Options: 'noise', 'block', 'off' ) profile = client.profile.create_profile(create_profile_request))
Use the appropriate WebGL spoofing type according to your needs for web related tasks.