SIM*_*SIM 1 selenium vba selenium-chromedriver selenium-webdriver
有什么办法可以在我的 vba 代码中使用那些被注释掉的四行,这样我就可以在进入一些容易通知的网页时摆脱障碍。我找不到任何想法,以便我能够利用它们,因为它们现在的情况会引发错误。这里是。提前致谢。
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
Run Code Online (Sandbox Code Playgroud)
这是你想要的?
With driver
.SetPreference "profile.default_content_setting_values.notifications", 2 '1 for allow 2 for block
.Start "chrome", "https://www.facebook.com"
.
.
.
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3609 次 |
| 最近记录: |