Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/vba/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
禁用图像-Selenium VBA Chromedriver_Vba_Excel_Selenium_Selenium Chromedriver - Fatal编程技术网

禁用图像-Selenium VBA Chromedriver

禁用图像-Selenium VBA Chromedriver,vba,excel,selenium,selenium-chromedriver,Vba,Excel,Selenium,Selenium Chromedriver,所以我只是学习vba和selenium的初学者。我试图点击chrome设置中的一个按钮来禁用图像,但是我不知道如何实现这一点 我使用了以下url: chrome://settings/content/images 然后尝试用鼠标单击切换按钮 driver.FindElementByCss("#button").Click 但是,我总是得到错误“Element not visible” 所以我发现这一定是因为html代码中的“#shadow root”。但是我不知道这意味着什么,也不知道如何找到

所以我只是学习vba和selenium的初学者。我试图点击chrome设置中的一个按钮来禁用图像,但是我不知道如何实现这一点

我使用了以下url:

chrome://settings/content/images

然后尝试用鼠标单击切换按钮

driver.FindElementByCss("#button").Click
但是,我总是得到错误“Element not visible”

所以我发现这一定是因为html代码中的“#shadow root”。但是我不知道这意味着什么,也不知道如何找到访问元素的方法。。。非常感谢您提供有关如何解决此问题的任何建议:-)


谢谢你的帮助

这并没有回答关于如何实际单击按钮的问题,但它确实得到了您想要的结果;)


@没错!在什么网页上?某些网页上有图像按钮。您刚刚阻止了他们的下载。这是链接:chrome://settings/content/imagesits 在chrome设置->高级->内容->图像下
Sub toggle_images()

Dim bot As New WebDriver
bot.Start "chrome", "chrome://settings/content/images"
bot.Get "/"

For i = 1 To 21
    bot.SendKeys bot.Keys.Tab
Next i

bot.SendKeys bot.Keys.Enter

End Sub