python - How to use send_keys in selenium webdriver in python?
问题描述
i want to move the canvas element using mouse right click and mouse move. how can i do with it actiondriver and send_keys in selenium. could someone help me with this. thanks.
i have tried something like
ActionChains(driver).move_to_element(canvas_element).send_keys(
Keys.chord(Keys.CONTROL, Keys.ADD)).build().perform();
this is to zoomin the canvas element. similarly how can i perform right click and mouse move.
解决方案
您可以context_click
在selenium.webdriver.common.action_chains中使用右键单击。
from selenium import webdriver
from selenium.webdriver import ActionChains
driver = webdriver.Chrome()
actionChains = ActionChains(driver)
actionChains.context_click(your_link).perform()
使用 Selenium Webdriver,您可以使用move_by_offset(xoffset, yoffset)
函数移动鼠标
推荐阅读
- .net-core - 我可以在 RavenDB 中使用构造函数重载吗?
- mysql - MySQL Debezium Kafka:此连接器不知道架构
- sql - 按特定值分区,然后在 Oracle 中按范围分区
- hive - 连接到 hive 以使用 kerberos 执行查询
- c++ - 编译后忽略 C++ 6.0 代码(日期时间计算器代码)
- python - 我收到了语法错误,但看不到有什么问题
- linux - 在 Amazon EC2 中从 php 5.3 和 apache 2.2 升级到 php 7 和 apache 2.4
- firebase - 在我的 Firebase 查询末尾添加了一个点
- r - 高效的增量存储和按时间戳快速恢复列表更改
- sharepoint - executeQueryAsync 回调函数偶尔执行