【发布时间】:2020-07-02 13:07:14
【问题描述】:
driver.get("https://www.google.com)
我想模拟用selenium按下Ctrl+Shift+c的过程
我试过了:
1. actions
.keyDown(Keys.CONTROL)
.keyDown(Keys.SHIFT)
.sendKeys("c")
.build()
.perform();
2. action.sendKeys(Keys.chord(Keys.SHIFT + Keys.CONTROL + "c")).perform();
StackOverflow 里有很多答案,但没有任何作用
【问题讨论】:
-
仅导航到页面后您希望复制什么?
-
它应该打开 devTools,但不建议使用 chromeOptions 的方式
-
为什么要模拟
Ctrl+Shift+c而忽略ChromeOptions?你的具体用例是什么? -
问题不仅在于Ctrl+Shift+c的使用,其他操作(Ctrl+t、Ctrl+Shift+o等)也不起作用
-
@NorayrSargsyan 你的用例是什么?你想通过
Ctrl+Shift+c或Ctrl+Shift+o做什么?