Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using PuppeteerSharp;
- using System;
- using System.Threading.Tasks;
- class Program
- {
- static async Task Main(string[] args)
- {
- // Define the ZenRows API URL
- string zenRowsApiUrl = "https://api.zenrows.com/v1/?apikey=<YOUR_ZENROWS_API_KEY>&url=https%3A%2F%2Fwww.g2.com%2F&js_render=true&antibot=true&premium_proxy=true";
- using var browserFetcher = new BrowserFetcher();
- await browserFetcher.DownloadAsync();
- var browser = await Puppeteer.LaunchAsync(new LaunchOptions
- {
- Headless = true
- });
- var page = await browser.NewPageAsync();
- // Send a request to the ZenRows API
- await page.GoToAsync(zenRowsApiUrl);
- // Retreive page content
- var pageContent = await page.GetContentAsync();
- Console.WriteLine(pageContent);
- await browser.CloseAsync();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement