Skip to content

Instantly share code, notes, and snippets.

@tuannguyenssu
Created August 8, 2019 08:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tuannguyenssu/0c941bcfb9d51e874912d5720805a0cd to your computer and use it in GitHub Desktop.
Save tuannguyenssu/0c941bcfb9d51e874912d5720805a0cd to your computer and use it in GitHub Desktop.
using System;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
namespace SeleniumTest
{
class Program
{
static void Main(string[] args)
{
// Đường dẫn tới thư mục chứa Chrome Driver
// Tải về tại đây https://chromedriver.chromium.org/downloads
// Thay đổi cho đúng với trường hợp của bạn
string chromeDriverPath = @"D:\ChromeDriver";
var options = new ChromeOptions();
options.AddArgument("no-sandbox");
// Chạy ngầm không pop up trình duyệt ra ngoài
//options.AddArgument("headless");
var driver = new ChromeDriver(chromeDriverPath, options, TimeSpan.FromDays(20));
string url = "https://www.dotnetcoban.com/";
driver.Url = url;
driver.Navigate().GoToUrl(url);
Console.ReadKey();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment