So I haven't been able to recreate the error you referenced. Instead, I encountered a number of
other errors in running the same code through Selenium which reminded me that Selenium can be pretty tempermental. Turns out that, in the intervening hour, I needed to update my ChromeDriver. All I can do is suggest that you check that your ChromeDriver matches your version of Chrome, and to try restarting your system. I did this, and then tried the following code, and it worked:
VBA Code:
Sub HeadlessSelenium_CD()
Dim CD As Selenium.ChromeDriver
Dim strHTML As String
' Instantiate Selenium through the ChromeDriver
Set CD = New Selenium.ChromeDriver
' Run Selenium in Headless mode
CD.AddArgument "--headless"
CD.Start
' Navigate to the URL
CD.Get "https://www.tokopedia.com/petanidaun/foliage-premium-plant-food-khusus-tanaman-hias-daun"
' Extract the HTML code of the website
strHTML = CD.PageSource
' Print the HTML code to the Immediate Window
Debug.Print strHTML
CD.Close
Set CD = Nothing
End Sub
I should also add that the target website looks to be a bit tricky - when I first tried accessing the site with my updated ChromeDriver, I didn't use headless mode, and it worked OK. But then when I tried to access it under headless mode, It produced the following HTML code:
HTML:
<html><head>
<title>Access Denied</title>
</head><body>
<h1>Access Denied</h1>
You don't have permission to access "http://www.tokopedia.com/petanidaun/foliage-premium-plant-food-khusus-tanaman-hias-daun" on this server.<p></p></body></html>
Let me know if you've managed to get ChromeDriver to run in headless mode.