简体   繁体   中英

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. Im fairly new to python though and im sure theres something ive missed, any bright ideas?

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

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()

Try PyAutoGUI .

You can pip install it, then add pyautogui.moveTo(x, y) in your Selenium script.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM