如何在VBA中使用含硒的Chrome选项? [英] How can I use chrome options in vba with selenium?
本文介绍了如何在VBA中使用含硒的Chrome选项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有什么办法可以在vba代码中使用注释掉的四行代码,以便在进入一些易于通知的网页时摆脱障碍.我找不到任何想法,因此我将能够利用它们,因为由于它们现在的状态,它会引发错误.这里是.预先感谢.
Is there any way I can use those commented out four lines in my vba code so that I can shake off barrier while entering some notifications prone webpages. I can't find any idea so that I will be able to make use of them as it is throwing error because of how they are now. Here it is. Thanks in advance.
Sub Test_stth()
Dim driver As New WebDriver
'chrome_options = WebDriver.ChromeOptions()
'prefs = {"profile.default_content_setting_values.notifications" : 2}
'chrome_options.add_experimental_option("prefs",prefs)
'driver = WebDriver.Chrome(chrome_options = chrome_options)
With driver
.Start "chrome", "https://stackoverflow.com/documentation"
.get "/documentation"
End With
End Sub
推荐答案
这是您要寻找的吗?
With driver
.SetPreference "profile.default_content_setting_values.notifications", 2 '1 for allow 2 for block
.Start "chrome", "https://www.facebook.com"
.
.
.
这篇关于如何在VBA中使用含硒的Chrome选项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文