Recently, I'm using Selenium to simulate login a website (https://passport.zhaopin.com/org/login). During this simulate login, I have to click at a certain position according to the coordinate so that I can pass the captcha. However, I get confused with a bug raised by selenium for a whole day. My code is shown as below:
from selenium import webdriver
import time
driver =webdriver.Firefox(executable_path="/Users/mountain/geckodriver")
url = "https://passport.zhaopin.com/org/login"
driver.get(url)
time.sleep(4)
img_element = driver.find_element_by_class_name("captcha-container")
actions = webdriver.common.action_chains.ActionChains(driver)
actions.move_to_element_with_offset(img_element, 50, 50).click().perform()
I can't understand why 50 isn't an integer.