'C# Selenium ChromeDrive can't open web with link

I'm new to C# and trying to follow a webscrape tutorial. Currently i have these software installed:

  1. Visual Studio 2022
  2. .NET.Core 6.0
  3. Selenium.WebDriver(from negut for project?)
  4. Chrome ver.101.0.4951.64
  5. ChromeDriver ver.101.0.4951.41 newest one i can found

Codes are here:

namespace WebScrape
{
    class Program
    {
        static void Main(string[] args)
        {
            IWebDriver drive = new ChromeDriver();
            drive.Navigate().GoToUrl("www.google.com");
        }
    }
}

After running the code, chrome do open, but only a blank page shown up with url "data:;" the console shows:

Starting ChromeDriver 101.0.4951.41 (93c720db8323b3ec10d056025ab95c23a31997c9-refs/branch-heads/4951@{#904}) on port 12473
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.

DevTools listening on ws://127.0.0.1:12476/devtools/browser/cfbbc4af-00d4-45c6-87a0-11cc31baa733
Unhandled exception. OpenQA.Selenium.WebDriverArgumentException: invalid argument
  (Session info: chrome=101.0.4951.64)
   at OpenQA.Selenium.WebDriver.UnpackAndThrowOnError(Response errorResponse)
   at OpenQA.Selenium.WebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.WebDriver.set_Url(String value)
   at OpenQA.Selenium.Navigator.GoToUrl(String url)
   at WebScrape.Program.Main(String[] args) in D:\DEV\CSharp_PROJ\WebScrape\WebScrape\Program.cs:line 17
[8060:25652:0512/142113.378:ERROR:device_event_log_impl.cc(214)] [14:21:13.378] USB: usb_device_handle_win.cc:1049 Failed to read descriptor from node connection: 连到系统上的设备没有发挥作用。 (0x1F)

Possible solution i have tried:

  1. Try different chromedirver version.(failed)
  2. Download older chrome version to match chromedriver version exactly.(failed)

Please, can I get some help_(:з」∠)_



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source