在VBA Excel中使用Selenium隐藏Edge浏览器



我有个问题要问,因为我遇到麻烦了。我希望在使用Selenium类型库运行VBA例程时能够隐藏浏览器边缘。

使用Chrome浏览器,我可以通过编写AddArgument来获得结果--"无头";但有了Edge浏览器,我不知道该怎么做。有人能帮我吗?

非常感谢!:-(

Dim web As New ChromeDriver
With web
.AddArgument "--headless"   ''Works with Chrome but doesn't work with Edge
'OTHER
End With

在我的例子中,下面的代码是有效的
您可以在https://github.com/florentbr/SeleniumBasic/issues/241由Maetes

Dim brwsr As New EdgeDriver
brwsr.SetCapability "ms:edgeOptions", "{""args"":[""--headless""]}"

最新更新