欧盟地区欧盟地区
You can target the entire European Union region in the same manner as “Country” above by adding “eu” after “country” in your request: “-country-eu”. 请求 sent using -country-eu, will use IPs from one of the countries below which are included automatically within “eu”: AL, AZ, KG, BA, UZ, BI, XK, SM, DE, AT, CH, UK, GB,IE, IM, FR, ES, NL, IT, PT, BE, AD, MT, MC, MA, LU, TN, DZ, GI, LI, SE, DK, FI, NO, AX, IS, GG, JE, EU, GL, VA, FX, FO.
Which coding languages, libraries, and webdrivers are supported by Scraping Browser?
using PuppeteerSharp; using System.Net.WebSockets; using System.Text; // Set the authentication credentials var auth = "USER:PASS"; // Construct the WebSocket URL with authentication var ws = $"wss://{auth}@zproxy.lum-superproxy.io:9222"; // Custom WebSocket factory function async Task<WebSocket> ws_factory(Uri url, IConnectionOptions options, CancellationToken cancellationToken) { // Create a new ClientWebSocket instance var socket = new ClientWebSocket(); // Extract the user information (username and password) from the URL var user_info = url.UserInfo; if (user_info != "") { // Encode the user information in Base64 format var auth = Convert.ToBase64String(Encoding.Default.GetBytes(user_info)); // Set the "Authorization" header of the WebSocket options with the encoded credentials socket.Options.SetRequestHeader("Authorization", $"Basic {auth}"); } // Disable the WebSocket keep-alive interval socket.Options.KeepAliveInterval = TimeSpan.Zero; // Connect to the WebSocket endpoint await socket.ConnectAsync(url, cancellationToken); return socket; } // Create ConnectOptions and configure the options var options = new ConnectOptions() { // Set the BrowserWSEndpoint to the WebSocket URL BrowserWSEndpoint = ws, // Set the WebSocketFactory to the custom factory function WebSocketFactory = ws_factory, }; // Connect to the browser using PuppeteerSharp Console.WriteLine("Connecting to browser..."); using (var browser = await Puppeteer.ConnectAsync(options)) { Console.WriteLine("Connected! Navigating..."); // Create a new page instance var page = await browser.NewPageAsync(); // Navigate to the specified URL await page.GoToAsync("https://example.com"); Console.WriteLine("Navigated! Scraping data..."); // Get the content of the page var content = await page.GetContentAsync(); Console.WriteLine("Done!"); Console.WriteLine(content); }
using PuppeteerSharp; using System.Net.WebSockets; using System.Text; // Set the authentication credentials var auth = "USER:PASS"; // Construct the WebSocket URL with authentication var ws = $"wss://{auth}@zproxy.lum-superproxy.io:9222"; // Custom WebSocket factory function async Task<WebSocket> ws_factory(Uri url, IConnectionOptions options, CancellationToken cancellationToken) { // Create a new ClientWebSocket instance var socket = new ClientWebSocket(); // Extract the user information (username and password) from the URL var user_info = url.UserInfo; if (user_info != "") { // Encode the user information in Base64 format var auth = Convert.ToBase64String(Encoding.Default.GetBytes(user_info)); // Set the "Authorization" header of the WebSocket options with the encoded credentials socket.Options.SetRequestHeader("Authorization", $"Basic {auth}"); } // Disable the WebSocket keep-alive interval socket.Options.KeepAliveInterval = TimeSpan.Zero; // Connect to the WebSocket endpoint await socket.ConnectAsync(url, cancellationToken); return socket; } // Create ConnectOptions and configure the options var options = new ConnectOptions() { // Set the BrowserWSEndpoint to the WebSocket URL BrowserWSEndpoint = ws, // Set the WebSocketFactory to the custom factory function WebSocketFactory = ws_factory, }; // Connect to the browser using PuppeteerSharp Console.WriteLine("Connecting to browser..."); using (var browser = await Puppeteer.ConnectAsync(options)) { Console.WriteLine("Connected! Navigating..."); // Create a new page instance var page = await browser.NewPageAsync(); // Navigate to the specified URL await page.GoToAsync("https://example.com"); Console.WriteLine("Navigated! Scraping data..."); // Get the content of the page var content = await page.GetContentAsync(); Console.WriteLine("Done!"); Console.WriteLine(content); }
Can I choose the country that the Scraping Browser will scrape from?
This is possible, but not recommended. The reason is that the Scraping Browser utilises Bright Data’s full suite of unblocking capabilities which automatically chooses the best IP type and location to get you the page you want to access.In case you still want to make the Scraping Browser work from a specific country, simply use the username that includes the country-xx in the configuration.See the example below for Puppeteer: We added -country-us to our request, so we will send a request originating from the United States (“us”).const SBR_WS_ENDPOINT = 'wss://brd-customer-<customer_id>-zone-<zone_name>-country-us:<password>@brd.superproxy.io:9222'
How does the Scraping Browser pricing work?
Scraping Browser pricing is simple: you only pay for gigabytes of traffic that you transferred through the Scraping Browser.There is no cost for instances or time using the Scraping Browsers - only traffic.It doesn’t matter what country you are using, traffic is billed at the same rates. Because you pay by traffic, you probably will want to minimize it.The only exception to this is premium domains, which cost more per gigabyte, because Bright Data needs to invest a significantly higher amount of effort and resources to unblock. You can find more information about premium domains in your Scraping Browser configuration pages.