我正在使用Selenium webdriver.我无法从右键单击打开的选项中选择(比如说第二个)选项.
在我当前的代码中,我可以右键单击webElement但无法从右键单击后打开的列表中选择一个选项,因为它会自动消失.
Actions action= new Actions(driver);
action.contextClick(productLink).build().perform();
Run Code Online (Sandbox Code Playgroud)
因此,使用此代码,我可以右键单击,但右键菜单会自动消失.我想从右键菜单中选择说第二个选项.
请帮忙!!!
我一直在寻找这个,但找不到Python的答案.
是否可以模拟右键单击,或通过selenium/chromedriver打开上下文菜单?
我见过Java和其他一些语言的选项,但从未在Python中看到过.如何模拟右键单击链接或图片,我需要做些什么?
python selenium webdriver selenium-chromedriver selenium-webdriver