我知道Google Chrome和Chromium的AppleScript功能还不是很强。但是,我想知道是否有一种方法可以使用“系统事件”来隐藏特定的窗口或选项卡?
这是我到目前为止所做的。
tell application "System Events"
tell process "Google Chrome"
repeat with theWindow in windows
set thePageName to title of theWindow
if thePageName contains "ABC
我有一段代码,基本上是使用actionchain触发浏览器快捷方式。我使用的是Chrome driver 2.27,通过Jupyter notebook运行python 3.6 (不过这没什么关系)。问题是,如果代码随着webdriver实例的创建一起运行,它就会正常工作,并显示下载栏。
相反,如果我运行代码来创建webdriver,打开新窗口,最小化它,然后尝试运行代码来触发快捷方式,它不起作用。我猜这与司机失去焦点有关,因为我手动偷看了新创建的窗口。
用于创建the驱动程序的代码
from selenium.webdriver.common.keys import Keys
from se