E
E
Etare2021-10-31 19:38:46
Python
Etare, 2021-10-31 19:38:46

Is there a way to visually hover over a website with Selenium?

The site uses a captcha slider and looks at the position of the cursor. Even if the captcha is solved correctly, but the cursor is not at least next to the captcha, it does not count the answer. What can be done and how to implement?

617ec671c0c24064946620.png

actions = ActionChains(driver)
    element = driver.find_element_by_xpath('//div[@class="captchaBlock"]/div/div/div/div')
    rand = [27.5, 28, 28.5, 29, 29.5, 30, 30.5, 31, 31.5, 32, 32.5]
    actions.drag_and_drop_by_offset(element, x + random.choice(rand), 0).click().perform()

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
rPman, 2021-10-31
@rPman

See action.moveToElement
as discussed here to the point

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question