【发布时间】:2020-04-09 05:16:44
【问题描述】:
我使用chrome作为驱动,双击/上下文单击后,提示窗口打开,但驱动程序不会切换到提示窗口。这是我尝试过的...我打开的页面是google.com,搜索,然后尝试右键单击,以便我可以在不同的选项卡中打开结果。提前致谢。
.......
element = driver.find_element_by_class_name("LC20lb")
actionchains = ActionChains(driver)
actionchains.context_click(element).perform()
# Driver needs to switch to the popup from here before it can press the down arrow.
sleep(5)
actionchains.send_keys(Keys.ARROW_DOWN).perform()
sleep(4)
driver.quit()
【问题讨论】:
标签: python selenium automation webdriver selenium-chromedriver