[英]Click on xy of a webpage using selenium in python?
Automating logging into homeroom everyday, the teacher posts a new link to meets everyday but the link is always in the same position on the screen.每天自动登录班级,老师发布了一个新的链接到日常会议,但该链接始终在屏幕上的相同位置。 I cant simply find element by xpath, id, class etc... This is why I figured if I could simply click on certain coordinates my problem would be solved but im having trouble doing this in selenium.
我不能简单地通过 xpath、id、class 等找到元素......这就是为什么我想如果我可以简单地点击某些坐标,我的问题就会解决,但我在 selenium 中这样做有困难。 Im fairly new to python though and im sure theres something ive missed, any bright ideas?
我对 python 相当陌生,我确定我错过了一些东西,有什么好主意吗?
Can actually not comment your question directly, cause of reputation - Would be great to show some code you have written or going more in to detail.实际上不能直接评论您的问题,这是声誉的原因 - 展示您编写的一些代码或更详细地说明会很棒。
Just a hint ActionChains只是一个提示 ActionChains
from selenium.webdriver.common.action_chains import ActionChains
actions = ActionChains(driver)
actions.move_to_element_with_offset(driver.find_element_by_tag_name('body'), 0,0)
actions.move_by_offset(X coordinates, Y coordinates).click().perform()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.