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 setWebGL
method in the Local API Clients. Below you can find the examples for Javascript and Python:
Examples
-
const createProfileRequest = BuilderForCreateProfile .forBaseProfile(chromeBaseProfileList[0].id) .setWebgl('noise') // Set WebGL spoofing type # Options: ('noise', 'block', 'off') .build(); const profile = await client.createProfile({ body: createProfileRequest });
-
create_profile_request = BuilderForCreateProfile \ .for_base_profile(base_profiles[0].id) \ .set_webgl('noise') # Set WebGL spoofing type # Options: ('noise', 'block', 'off') .build() profile = client.create_profile(body=create_profile_request)
Use the appropriate WebGL spoofing type according to your needs for web related tasks.
For your convenience, this functionality is provided by the Python Builder and JavaScript Builder for Profile Creation in the Local API Clients.